farmbot v6.0.1-alpha Farmbot.HTTP View Source
Wraps an HTTP Adapter.
Link to this section Summary
Functions
Download a file to the filesystem
HTTP GET request
Same as get/3
but raises
HTTP POST request
Same as post/4
but raises
Make an http request. Will not raise.
method
- can be any http verburl
- fully formatted url or an api slug.body
- body can be any of:- binary
{:multipart, [{binary_key, binary_value}]}
- headers -
[{binary_key, binary_value}]
opts - Keyword opts to be passed to adapter (hackney/httpoison)
file
- option to be passed if the output should be saved to a file
Same as request/5
but raises
Start HTTP Services
Upload a file to FB storage
Link to this section Functions
Link to this function
download_file(url, path, progress_callback \\ nil, payload \\ "", headers \\ [])
View Source
Download a file to the filesystem.
Link to this function
get(url, headers \\ [], opts \\ [])
View Source
get(url, headers, opts) :: {:ok, Farmbot.HTTP.Response.t} | {:error, term}
HTTP GET request.
Link to this function
get!(url, headers \\ [], opts \\ [])
View Source
get!(url, headers, opts) :: Farmbot.HTTP.Response.t | no_return
Same as get/3
but raises.
HTTP POST request.
Same as post/4
but raises.
Link to this function
request(method, url, body \\ "", headers \\ [], opts \\ [])
View Source
request(method, url, body, headers, opts) :: {:ok, Farmbot.HTTP.Response.t} | {:error, term}
Make an http request. Will not raise.
method
- can be any http verburl
- fully formatted url or an api slug.body
- body can be any of:- binary
{:multipart, [{binary_key, binary_value}]}
- headers -
[{binary_key, binary_value}]
opts - Keyword opts to be passed to adapter (hackney/httpoison)
file
- option to be passed if the output should be saved to a file.
Link to this function
request!(method, url, body \\ "", headers \\ [], opts \\ [])
View Source
request!(method, url, body, headers, opts) :: Farmbot.HTTP.Response.t | no_return
Same as request/5
but raises.
Start HTTP Services.
Upload a file to FB storage.