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: Response | GlobusHTTPResponse, client: globus_sdk.BaseClient | None = None)[source]#
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.
If the response data is not a dictionary or list, item access will raise
>>> print("Response ID": r["id"]) # alias for r.data["id"]
client – The client instance which made the request
- get(key: str, default: Any | None = None) Any [source]#
getis just an alias for
data.get(key, default), but with the added checks that if
Noneor a list, it returns the default.
- property headers: Mapping[str, str]#
The HTTP response headers as a case-insensitive mapping.
headers["content-length"]are treated as equivalent.
- property http_reason: str#
The HTTP reason string from the response.
This is the part of the status line after the status code, and typically is a string description of the status. If the status line is
HTTP/1.1 200 OK, then this is the string
- class globus_sdk.response.IterableResponse(response: Response | GlobusHTTPResponse, client: globus_sdk.BaseClient | None = None, *, iter_key: str | None = None)[source]#
This response class adds an __iter__ method on an ‘iter_key’ variable. The assumption is that iter produces dicts or dict-like mappings.