farmbot v6.4.1 Farmbot.HTTP.Adapter behaviour View Source
Behaviour for a Farmbot HTTP adapter implementation.
Link to this section Summary
Types
Adapter pid
HTTP request payload
HTTP request header
HTTP method
Options to the underlying http adapter
Callback for progress of a downloaded file. Arg 1 should be the the downloaded bytes. Arg 2 should be the total number of bytes, nil, or the atom :complete
HTTP Status code
A json serializable map of meta data about an upload
HTTP url. Must be fully formatted
Link to this section Types
Adapter pid.
HTTP request payload.
HTTP request header.
HTTP method.
Options to the underlying http adapter.
Callback for progress of a downloaded file. Arg 1 should be the the downloaded bytes. Arg 2 should be the total number of bytes, nil, or the atom :complete
HTTP Status code.
A json serializable map of meta data about an upload.
HTTP url. Must be fully formatted.
Link to this section Callbacks
download_file( adapter(), url(), Path.t(), progress_callback(), body(), headers(), stream_fun() ) :: {:ok, Path.t()} | {:error, term()}
Download a file to the Filesystem.
HTTP Request.
Start the adapter.
upload_file(adapter(), Path.t(), upload_meta()) :: :ok | {:error, term()}
Upload a file.