NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Install Python on your system.  Create a text file with the .py extension and run with the "python myrestclient.py" command

Code Block
languagepython
titleSimple Python Rest Client
collapsetrue
__author__ = 'sbauer'
import urllib2

try:
    file = urllib2.urlopen('http://bmidev4:5555/cts2/resolvedvaluesets')
except urllib2.URLError, e:
    if e.code == 404:
        print("check url")
#     continue to handle other errors here
else:
    print(file.read())

...