crawlie v0.5.1 Crawlie.Response
Defines the struct representing a page retrieved by the http client.
Summary
Types
The Crawlie.Response
struct type
Functions
Retrieves the content type of the response
Retrieves the content type of the response, just the “type/subtype” part, with no additional parameters, if there are any in the Content-Type header value
Constructs the Crawlie.Response
struct
Returns the string representation of the uri
contained in the Crawlie.Response
struct
Types
The Crawlie.Response
struct type.
Functions
Retrieves the content type of the response.
Example
iex> alias Crawlie.Response
iex> url = "https://foo.bar/"
iex> headers = [{"Content-Type", "text/html; charset=UTF-8"}]
iex> response = Response.new(url, 200, headers, "<html />")
iex> Response.content_type(response)
"text/html; charset=UTF-8"
Retrieves the content type of the response, just the “type/subtype” part, with no additional parameters, if there are any in the Content-Type header value.
Example
iex> alias Crawlie.Response
iex> url = "https://foo.bar/"
iex> headers = [{"Content-Type", "text/html; charset=UTF-8"}]
iex> response = Response.new(url, 200, headers, "<html />")
iex> Response.content_type_simple(response)
"text/html"
new(String.t | URI.t, integer, [{String.t, String.t}], binary) :: Crawlie.Response.t
Constructs the Crawlie.Response
struct.
Example
iex> alias Crawlie.Response
iex> url = "https://foo.bar/"
iex> headers = [{"Content-Type", "text/plain"}]
iex> response = Response.new(url, 200, headers, "body")
iex> response.body
"body"
iex> response.status_code
200
Returns the string representation of the uri
contained in the Crawlie.Response
struct.