NIH | National Cancer Institute | NCI Wiki  

Error rendering macro 'rw-search'

null

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://informatics.mayo.edu/cts2/rest")
reply = conn.request_get("/valuesets")
if reply['headers']['status'] == '200':
    print reply['body']


conn = Connection("http://informatics.mayo.edu/cts2/rest")
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://informatics.mayo.edu/cts2/rest")
print conn.request_get("/valuesets?matchvalue='Sequence'")['body']

Unix Command Line

returns XML that can be piped to a file

Code Block
languagebash
titleShell Script using Unix curl command
r0223758:~ m029206$ curl http://informatics.mayo.edu/cts2/rest/codesystemversions

 

The Current State of CTS2

...