View Source DatadogHttp.Client (Datadog HTTP v0.0.1)

Functions to build a Tesla client for handling HTTP requests.

Link to this section Summary

Functions

Creates a new Tesla client. Optional config argument sets the following values at runtime

Link to this section Functions

@spec new(map()) :: Tesla.Client.t()

Creates a new Tesla client. Optional config argument sets the following values at runtime:

  • Base URL
  • API Key
  • Tesla.Adapter
  • Tesla.Middleware
  • HTTP options for selected Tesla.Adapter Example
    config = %{
      base_url: "https://api.datadoghq.com",
      api_key: "some-api-key",
      adapter: Tesla.Adapter.Httpc,
      middleware: [Tesla.Middleware.Logger],
      http_options: [recv_timeout: 10_000]
    }
    client = Client.new(config)