A raw response body (Markdown, plain text, PDF or JSON) with the metadata sent in the response headers.
:body- text in UTF-8, or the binary PDF:content_type- content type of the body:filename- suggested file name in UTF-8, PDF only; contains no path separators:credits_charged- credits charged by this call:credits_remaining- credits left:rate_limit_remaining- requests left in this minute;nilfor accounts without a limit:posts_returned- posts in the document, quoted posts included; Markdown and text only
to_string/1 returns the body.
Summary
Functions
Writes the body to path.
Parses the body of a swap call made with format: :json into a TwitterViewer.ConvertResult.
Types
@type t() :: %TwitterViewer.Document{ body: binary(), content_type: String.t(), credits_charged: non_neg_integer() | nil, credits_remaining: non_neg_integer() | nil, filename: String.t() | nil, posts_returned: non_neg_integer() | nil, rate_limit_remaining: non_neg_integer() | nil }
Functions
@spec save(t(), Path.t()) :: :ok | {:error, File.posix()}
Writes the body to path.
@spec to_convert_result(t()) :: {:ok, TwitterViewer.ConvertResult.t()} | {:error, TwitterViewer.UnexpectedResponseError.t()}
Parses the body of a swap call made with format: :json into a TwitterViewer.ConvertResult.