Index Documentation

HttpMessage
in package

AbstractYes

Represents a base HTTP message.

Table of Contents

Methods

__construct()  : mixed
getContent()  : HttpContent|null
Retrieves message body contents, if present.
getHeader()  : HttpHeader
Retrieves a header by name.
getHeaderFirstLine()  : string
Gets the first line of a header.
getHeaderLine()  : string
Gets the contents of a header as a string.
getHeaderLines()  : array<string|int, string>
Gets lines of a header.
getHeaders()  : array<string|int, HttpHeader>
Retrieves the collection of headers for this HTTP message.
getHttpVersion()  : string
Retrieves the HTTP version of this message.
hasContent()  : bool
Checks whether this HTTP message has body contents.
hasHeader()  : bool
Checks if a header is present.
isBencodeContent()  : bool
Checks if the body content is BencodeHttpContent.
isFormContent()  : bool
Checks if the body content is FormHttpContent.
isJsonContent()  : bool
Checks if the body content is JsonHttpContent.
isStringContent()  : bool
Checks if the body content is StringHttpContent.

Methods

getContent()

Retrieves message body contents, if present.

public getContent() : HttpContent|null
Return values
HttpContent|null

Body contents, null if none present.

getHeader()

Retrieves a header by name.

public getHeader(string $name) : HttpHeader
Parameters
$name : string

Name of the header.

Tags
throws
RuntimeException

If no header with $name exists.

Return values
HttpHeader

Instance of the requested header.

getHeaderFirstLine()

Gets the first line of a header.

public getHeaderFirstLine(string $name) : string
Parameters
$name : string

Name of the header.

Return values
string

First line of the header.

getHeaderLine()

Gets the contents of a header as a string.

public getHeaderLine(string $name) : string
Parameters
$name : string

Name of the header.

Return values
string

Contents of the header.

getHeaderLines()

Gets lines of a header.

public getHeaderLines(string $name) : array<string|int, string>
Parameters
$name : string

Name of the header.

Return values
array<string|int, string>

Header lines.

getHeaders()

Retrieves the collection of headers for this HTTP message.

public getHeaders() : array<string|int, HttpHeader>
Return values
array<string|int, HttpHeader>

HTTP headers.

getHttpVersion()

Retrieves the HTTP version of this message.

public getHttpVersion() : string
Return values
string

HTTP version.

hasContent()

Checks whether this HTTP message has body contents.

public hasContent() : bool
Return values
bool

true if it has body contents.

hasHeader()

Checks if a header is present.

public hasHeader(string $name) : bool
Parameters
$name : string

Name of the header.

Return values
bool

true if the header is present.

isBencodeContent()

Checks if the body content is BencodeHttpContent.

public isBencodeContent() : bool
Return values
bool

true if it is BencodeHttpContent.

isFormContent()

Checks if the body content is FormHttpContent.

public isFormContent() : bool
Return values
bool

true if it is FormHttpContent.

isJsonContent()

Checks if the body content is JsonHttpContent.

public isJsonContent() : bool
Return values
bool

true if it is JsonHttpContent.

isStringContent()

Checks if the body content is StringHttpContent.

public isStringContent() : bool
Return values
bool

true if it is StringHttpContent.


        
On this page

Search results