NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

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

...

Code Block
languagepython
titlePython REST Client
collapsetrue
__author__ = 'sbauer'
from restful_lib import Connection

conn = Connection("http://http://lexevscts2.nci.nih.gov/lexevscts2")
reply = conn.request_get("/valuesets")
if reply['headers']['status'] == '200':
    print reply['body']


conn = Connection("http://http://lexevscts2.nci.nih.gov/lexevscts2")
reply = conn.request_get("/valuesets?format=json",headers={'Accept':'application/json;q=1.0'})
if reply['headers']['status'] == '200':
    print reply['body']
    print eval(reply['body'])

conn = Connection("http://http://lexevscts2.nci.nih.gov/lexevscts2")
print conn.request_get("/valuesets?matchvalue='Sequence'")['body']

 

Unix Command Line

returns XML that can be piped to a file

...