semtk3.restclient module

class semtk3.restclient.RestClient(baseURL, service=None)

Bases: object

HEADERS = {'cache-control': 'no-cache'}
post(endpoint, dataObj={}, files=None)

basic POST endpoint - string dataObj - dict will be converted to json for the post (default {})

returns string - response content raises RestException if response is not OK

post_to_file(endpoint, dataObj, filename)
raise_exception(msg)
static set_headers(headers)
to_json_array(to_jsonable_list)
exception semtk3.restclient.RestException

Bases: Exception

Exception for errors from rest endpoints