Sippet.Message.StatusLine.new

You're seeing just the function new, go back to Sippet.Message.StatusLine module for more information.

Specs

new(status_code()) :: t() | no_return()

Returns a Status-Line struct.

The reason_phrase is obtained from default values.

The function will throw an exception if the status_code is not in the valid range 100..699 or if the status_code does not have a default reason phrase.

The version will assume the default value {2, 0}.

Examples

iex> Sippet.Message.StatusLine.new(400)
%Sippet.Message.StatusLine{reason_phrase: "Bad Request", status_code: 400,
 version: {2, 0}}
Link to this function

new(status_code, reason_phrase)

View Source

Specs

new(status_code(), reason_phrase :: binary()) :: t()

Creates a Status-Line struct using a given reason phrase.

In this function, the reason_phrase can be anything the application wants.

The function will throw an exception if the status_code is not in the valid range 100..699.

The version will assume the default value {2, 0}.

Examples

iex> Sippet.Message.StatusLine.new(499, "Foobar")
%Sippet.Message.StatusLine{reason_phrase: "Foobar", status_code: 499,
 version: {2, 0}}