Sending Your Own Requests to the API
Client Class and Methods
- class openet_client.OpenETClient(token=None)
- send_request(endpoint, method='get', disable_encoding=False, **kwargs)
Handles sending most requests to the API - they provide the endpoint and the args. Since the API is in the process of switching from GET to POST requests, we have logic that switches between those depending on the request method
- Parameters:
endpoint – The text path to the OpenET endpoint - e.g. raster/export - skip the base URL.
method – “get” or “post” (case sensitive) - should match what the API supports for the endpoint
kwargs – The arguments to send (via get or post) to the API
- Returns:
requests.Response object of the results.