graviti.openapi.requests#

The basic concepts and methods of the Graviti OpenAPI.

Module Contents#

Functions#

do(method, url, **kwargs)

Send a request.

open_api_do(method, access_key, url, **kwargs)

Send a request to the Graviti OpenAPI.

Attributes#

graviti.openapi.requests.RESPONSE_ERROR_DISTRIBUTOR[source]#
graviti.openapi.requests.do(method, url, **kwargs)[source]#

Send a request.

Parameters
  • method (str) – The method of the request.

  • url (str) – The URL of the request.

  • **kwargs – Extra keyword arguments to send in the GET request.

  • kwargs (Any) –

Returns

Response of the request.

Return type

requests.models.Response

graviti.openapi.requests.open_api_do(method, access_key, url, **kwargs)[source]#

Send a request to the Graviti OpenAPI.

Parameters
  • method (str) – The method of the request.

  • access_key (str) – User’s access key.

  • url (str) – The URL of the graviti website.

  • **kwargs – Extra keyword arguments to send in the POST request.

  • kwargs (Any) –

Raises

ResponseError – When the status code OpenAPI returns is unexpected.

Returns

Response of the request.

Return type

requests.models.Response