Http Client

class opensearchpy.client.http.HttpClient(client)[source]

Bases: NamespacedClient

Parameters:

client (Client) –

delete(url, headers=None, params=None, body=None)[source]

Perform a DELETE request and return the data.

Parameters:
  • url (str) – absolute url (without host) to target

  • headers (Mapping[str, Any] | None) – dictionary of headers, will be handed over to the underlying Connection class

  • params (Mapping[str, Any] | None) – dictionary of query parameters, will be handed over to the underlying Connection class for serialization

  • body (Any | None) – body of the request, will be serialized using serializer and passed to the connection

  • url

  • headers

  • params

  • body

Return type:

Any

get(url, headers=None, params=None, body=None)[source]

Perform a GET request and return the data.

Parameters:
  • url (str) – absolute url (without host) to target

  • headers (Mapping[str, Any] | None) – dictionary of headers, will be handed over to the underlying Connection class

  • params (Mapping[str, Any] | None) – dictionary of query parameters, will be handed over to the underlying Connection class for serialization

  • body (Any | None) – body of the request, will be serialized using serializer and passed to the connection

  • url

  • headers

  • params

  • body

Return type:

Any

head(url, headers=None, params=None, body=None)[source]

Perform a HEAD request and return the data.

Parameters:
  • url (str) – absolute url (without host) to target

  • headers (Mapping[str, Any] | None) – dictionary of headers, will be handed over to the underlying Connection class

  • params (Mapping[str, Any] | None) – dictionary of query parameters, will be handed over to the underlying Connection class for serialization

  • body (Any | None) – body of the request, will be serialized using serializer and passed to the connection

  • url

  • headers

  • params

  • body

Return type:

Any

post(url, headers=None, params=None, body=None)[source]

Perform a POST request and return the data.

Parameters:
  • url (str) – absolute url (without host) to target

  • headers (Mapping[str, Any] | None) – dictionary of headers, will be handed over to the underlying Connection class

  • params (Mapping[str, Any] | None) – dictionary of query parameters, will be handed over to the underlying Connection class for serialization

  • body (Any | None) – body of the request, will be serialized using serializer and passed to the connection

  • url

  • headers

  • params

  • body

Return type:

Any

put(url, headers=None, params=None, body=None)[source]

Perform a PUT request and return the data.

Parameters:
  • url (str) – absolute url (without host) to target

  • headers (Mapping[str, Any] | None) – dictionary of headers, will be handed over to the underlying Connection class

  • params (Mapping[str, Any] | None) – dictionary of query parameters, will be handed over to the underlying Connection class for serialization

  • body (Any | None) – body of the request, will be serialized using serializer and passed to the connection

  • url

  • headers

  • params

  • body

Return type:

Any