shopify_requests.rest_client module¶
-
class
shopify_requests.rest_client.
RestClient
(myshopify_domain, access_token=None, username=None, password=None, connect_retries=None, backoff_factor=None, max_limit_retries=None, limit_backoff_factor=None, version=None)¶ Bases:
object
Create a session client for this Shopify store.
- Note
Only access_token or (username and password) are required
- urllib3 documents backoff_factor as
{backoff factor} * (2 ** ({number of total retries} - 1))
- Parameters
myshopify_domain – foobar.myshopify.com
access_token – OAuth token from a pubilc app
username – Username for private app
password – Password for private app
connect_retries –
[default: 3]
how many connection-related errors to retry onbackoff_factor –
[default: 0.5]
how quickly to backoff for safe retriesmax_limit_retries –
[default: 0]
how many retries to do when rate limitedlimit_backoff_factor –
[default: 0.5]
same as backoff_factor but for rate limitedversion –
[default: unstable]
the Shopify API version to use
-
calls_remaining
()¶ Return the number of API calls remaining.
- Return type
int
- See also
-
calls_used
()¶ Return the number of API calls used.
- Return type
int
- See also
-
close
()¶ Close the session.
- See also
-
delete
(url, **kwargs)¶ Send a DELETE request.
- Parameters
url – URL for the new Request object.
**kwargs – Optional arguments that session takes.
- Return type
- See also
-
get
(url, **kwargs)¶ Send a GET request.
- Parameters
url – URL for the new Request object.
**kwargs – Optional arguments that session takes.
- Return type
- See also
-
max_available
()¶ Return the bucket size for the token.
- Return type
int
- See also
-
patch
(url, **kwargs)¶ Send a PATCH request.
- Parameters
url – URL for the new Request object.
**kwargs – Optional arguments that session takes.
- Return type
- See also
-
post
(url, **kwargs)¶ Send a POST request.
- Parameters
url – URL for the new Request object.
**kwargs – Optional arguments that session takes.
- Return type
- See also
-
put
(url, **kwargs)¶ Send a PUT request.
- Parameters
url – URL for the new Request object.
**kwargs – Optional arguments that session takes.
- Return type
- See also