AlpacaElixir v2.2.0 Alpaca.Client View Source
Client responsible for making requests to Alpaca and handling the responses.
This client allows us to define all of our HTTP request logic and configuration in one place so that we can easily change or adapt this away from all of the other business logic of our library.
We have access to HTTP request types on this client and it will automatically use a base url as well as set all the necessary headers for us.
We have access to GET, POST, PATCH, and DELETE HTTP requests using this client.
Example usage
Alpaca.Client.get("/path", %{query_param: "value"})
Alpaca.Client.post("/path", %{param1: "value"})
Alpaca.Client.patch("/path", %{param1: "value"})
Alpaca.Client.delete("/path")
Link to this section Summary
Functions
Issue a delete request using the HTTP client
Issue a get request using the HTTP client
Issue a patch request using the HTTP client
Issue a post request using the HTTP client
Issue a put request using the HTTP client
Link to this section Functions
Specs
api_host() :: String.t()
Specs
Specs
Specs
data_api_host() :: String.t()
Issue a delete request using the HTTP client
Accepts path which is the url path of the request, will be added to the end of the base_url
Issue a get request using the HTTP client
Accepts path which is the url path of the request, will be added to the end of the base_url and a map of params which will become the query list for the get request
Issue a patch request using the HTTP client
Accepts path which is the url path of the request, will be added to the end of the base_url and a map of params which will be the body of the post request
Issue a post request using the HTTP client
Accepts path which is the url path of the request, will be added to the end of the base_url and a map of params which will be the body of the post request
Issue a put request using the HTTP client
Accepts path which is the url path of the request, will be added to the end of the base_url and a map of params which will be the body of the post request