HTTPStream.Request (HTTPStream v1.0.0) View Source
Struct that represents a request.
Fields:
scheme
:atom()
- e.g.:http
host
:binary()
- e.g."localhost"
port
:integer()
- e.g.80
path
:binary()
- e.g"/users/1/avatar.png"
method
:String.t()
- e.g."GET"
headers
:keyword()
- e.g.[authorization: "Bearer 123"]
body
:binary()
- e.g.{ "id": "1" }
Link to this section Summary
Functions
Parses a given URL and uses a given method to generate a valid
HTTPStream.Request
struct.
Link to this section Types
Specs
Link to this section Functions
Specs
Parses a given URL and uses a given method to generate a valid
HTTPStream.Request
struct.
Supported options:
headers
- HTTP headers to be sent.body
- Body of the HTTP request. This will be the requestquery
field if the method is one of "GET", "TRACE", "HEAD", "OPTIONS" and "DELETE".
This function raises an ArgumentError
if the HTTP method is unsupported or
the url
argument isn't a string.