cterasdk.client.http module#

class cterasdk.client.http.ContentType#

Bases: object

application_json = {'Content-Type': 'application/json'}#
textplain = {'Content-Type': 'text/plain'}#
urlencoded = {'Content-Type': 'application/x-www-form-urlencoded'}#
class cterasdk.client.http.HTTPClient(session_id_key)#

Bases: HttpClientBase

copy(src, dest, overwrite, headers=None)#
delete(url, headers=None)#
get(url, params=None, headers=None, stream=None)#
mkcol(url, headers=None)#
move(src, dest, overwrite, headers=None)#
multipart(url, form_data, monitor_function_generator=None)#
post(url, headers=None, data='', urlencode=False)#
put(url, headers=None, data='')#
upload(url, form_data)#
exception cterasdk.client.http.HTTPException(http_error)#

Bases: Exception

class cterasdk.client.http.HTTPResponse(response)#

Bases: object

getcode()#
geturl()#
read()#
class cterasdk.client.http.HttpClientBase(session_id_key)#

Bases: object

dispatch(ctera_request)#
get_session_id()#
on_ssl_error(request)#
static on_timeout(attempt)#
set_custom_headers(headers)#

Add custom headers that will be included in every http request.

Parameters:

headers (dict) – the headers, represented as a key-value str dict

set_session_id(session_id)#
should_trust(uri)#
trust()#
class cterasdk.client.http.HttpClientRequest(method, url, **kwargs)#

Bases: object

class cterasdk.client.http.HttpClientRequestCopy(src, dest, overwrite, headers=None)#

Bases: HttpClientRequestCopyMove

class cterasdk.client.http.HttpClientRequestCopyMove(method, src, dest, overwrite, headers=None)#

Bases: HttpClientRequest

class cterasdk.client.http.HttpClientRequestDelete(url, headers=None)#

Bases: HttpClientRequest

class cterasdk.client.http.HttpClientRequestGet(url, params=None, headers=None, stream=None)#

Bases: HttpClientRequest

class cterasdk.client.http.HttpClientRequestMkcol(url, headers=None)#

Bases: HttpClientRequest

class cterasdk.client.http.HttpClientRequestMove(src, dest, overwrite, headers=None)#

Bases: HttpClientRequestCopyMove

class cterasdk.client.http.HttpClientRequestPost(url, headers=None, data=None)#

Bases: HttpClientRequest

class cterasdk.client.http.HttpClientRequestPut(url, headers=None, data=None)#

Bases: HttpClientRequest

cterasdk.client.http.geturi(baseurl, path)#