Unless noted otherwise, all method return values for Globus SDK Clients are
To customize client methods with additional detail, the SDK uses subclasses of
- class globus_sdk.response.GlobusHTTPResponse(response: Union[requests.models.Response, GlobusHTTPResponse], client: Optional[globus_sdk.BaseClient] = None)¶
Response object that wraps an HTTP response from the underlying HTTP library. If the response is JSON, the parsed data will be available in
textshould be used instead.
The most common response data is a JSON dictionary. To make handling this type of response as seamless as possible, the
GlobusHTTPResponseobject implements the immutable mapping protocol for dict-style access. This is just an alias for access to the underlying data.
datais not a dictionary, item access will raise
>>> print("Response ID": r["id"]) # alias for r.data["id"]
http_status – HTTP status code returned by the server (int)
content_type – Content-Type header returned by the server (str)
client – The client instance which made the request
- get(key: str, default: Optional[Any] = None) Any ¶
getis just an alias for
data.get(key, default), but with the added check that if
None, it returns the default.
- property text: str¶
The raw response data as a string.
- class globus_sdk.response.IterableResponse(response: Union[requests.models.Response, GlobusHTTPResponse], client: Optional[globus_sdk.BaseClient] = None, *, iter_key: Optional[str] = None)¶
This response class adds an __iter__ method on an ‘iter_key’ variable. The assumption is that iter produces dicts or dict-like mappings.