CFXXL v0.1.0 CFXXL.Client View Source

Handle the client to be passed as parameter when using CFXXL functions.

Link to this section Summary

Functions

The struct representing a Client, it contains the endpoint and options to be passed when making a request

Returns a default client

Creates a client with the given parameters

Link to this section Functions

Link to this function %CFXXL.Client{} View Source (struct)

The struct representing a Client, it contains the endpoint and options to be passed when making a request.

Returns a default client

Examples

iex> CFXXL.Client.new()
%CFXXL.Client{endpoint: "http://localhost:8888/api/v1/cfssl", options: []}
Link to this function new(base_url, options \\ []) View Source

Creates a client with the given parameters.

Arguments

  • base_url: the base URL to reach CFSSL, without the API prefix.
  • options: a keyword list with options passed to HTTPoison when making a request.

Options

  • :timeout
  • :recv_timeout
  • :proxy
  • :proxy_auth
  • :ssl

For the documentation of the options see HTTPoison.request/5

Examples

iex> CFXXL.Client.new("https://ca.example.com:10000", recv_timeout: 15000)
%CFXXL.Client{endpoint: "https://ca.example.com:10000/api/v1/cfssl", options: [recv_timeout: 15000]}