maxwell v2.2.3 Maxwell.Adapter.Util
Utils for Adapter
Link to this section Summary
Functions
Check req_headers has transfer-encoding: chunked
Add content-type to headers if don’t have;
Add content-length to headers if not chunked
Converts the headers map to a list of tuples
Encode multipart form
Fetch the first element from stream
Append path and query string to url
Link to this section Functions
Link to this function
chunked?(conn)
Check req_headers has transfer-encoding: chunked.
conn-Maxwell.Conn
Link to this function
file_header_transform(chunked, conn)
Add content-type to headers if don’t have;
Add content-length to headers if not chunked
chunked-boolean, is chunked modeconn-Maxwell.Conn
Link to this function
header_serialize(headers)
Converts the headers map to a list of tuples.
headers-Map.t, for example:%{"content-type" => "application/json"}
Examples
iex> headers_serialize(%{"content-type" => "application/json"})
[{"content-type", "application/json"}]
Link to this function
multipart_encode(conn, multiparts)
Encode multipart form.
conn-Maxwell.Connmultiparts- seeMaxwell.Multipart.encode_form/2
Link to this function
stream_iterate(filepath)
Fetch the first element from stream.
Link to this function
url_serialize(url, path, query_string, type \\ :string)
Append path and query string to url
url-conn.urlpath-conn.pathquery-conn.querytype-:char_listor:string, default is :string
Examples
#http://example.com/home?name=foo
iex> url_serialize("http://example.com", "/home", %{"name" => "foo"})