farmbot v6.0.0 Farmbot.HTTP View Source

Farmbot HTTP adapter for accessing the world and farmbot web api easily.

Link to this section Summary

Functions

Same as delete/5 but raises Farmbot.HTTP.Error exception

Same as get/5 but raises Farmbot.HTTP.Error exception

Same as patch/5 but raises Farmbot.HTTP.Error exception

Same as post/5 but raises Farmbot.HTTP.Error exception

Same as put/5 but raises Farmbot.HTTP.Error exception

Make an http request. Will not raise.

  • method - can be any http verb
  • url - 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 section Functions

Link to this function delete(http, url, body \\ "", headers \\ [], opts \\ []) View Source

HTTP delete request.

Link to this function delete!(http, url, body \\ "", headers \\ [], opts \\ []) View Source

Same as delete/5 but raises Farmbot.HTTP.Error exception.

Link to this function download_file(http, url, path, progress_callback \\ nil, payload \\ "", headers \\ []) View Source
Link to this function download_file!(http, url, path, progress_callback \\ nil, payload \\ "", headers \\ []) View Source
Link to this function get(http, url, body \\ "", headers \\ [], opts \\ []) View Source

HTTP get request.

Link to this function get!(http, url, body \\ "", headers \\ [], opts \\ []) View Source

Same as get/5 but raises Farmbot.HTTP.Error exception.

Link to this function patch(http, url, body \\ "", headers \\ [], opts \\ []) View Source

HTTP patch request.

Link to this function patch!(http, url, body \\ "", headers \\ [], opts \\ []) View Source

Same as patch/5 but raises Farmbot.HTTP.Error exception.

Link to this function post(http, url, body \\ "", headers \\ [], opts \\ []) View Source

HTTP post request.

Link to this function post!(http, url, body \\ "", headers \\ [], opts \\ []) View Source

Same as post/5 but raises Farmbot.HTTP.Error exception.

Link to this function put(http, url, body \\ "", headers \\ [], opts \\ []) View Source

HTTP put request.

Link to this function put!(http, url, body \\ "", headers \\ [], opts \\ []) View Source

Same as put/5 but raises Farmbot.HTTP.Error exception.

Link to this function request(http, method, url, body \\ "", headers \\ [], opts \\ []) View Source

Make an http request. Will not raise.

  • method - can be any http verb
  • url - 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!(http, method, url, body \\ "", headers \\ [], opts \\ []) View Source

Same as request/6 - but raises a Farmbot.HTTP.Error exception.

Link to this function upload_file(http, path, meta \\ nil) View Source
Link to this function upload_file!(http, path, meta \\ %{}) View Source