Index Documentation

JsonHttpContent
in package
implements HttpContent, JsonSerializable

Represents JSON body content for a HTTP message.

Table of Contents

Interfaces

HttpContent
Represents the body content for a HTTP message.
JsonSerializable

Methods

__construct()  : mixed
__toString()  : string
encode()  : string
Encodes the content.
fromEncoded()  : JsonHttpContent
Creates an instance from encoded content.
fromFile()  : JsonHttpContent
Creates an instance from an encoded file.
fromRequest()  : JsonHttpContent
Creates an instance from the raw request body.
getContent()  : mixed
Retrieves unencoded content.
jsonSerialize()  : mixed

Methods

__construct()

public __construct(mixed $content) : mixed
Parameters
$content : mixed

Content to be JSON encoded.

encode()

Encodes the content.

public encode() : string
Return values
string

JSON encoded string.

fromEncoded()

Creates an instance from encoded content.

public static fromEncoded(string $encoded) : JsonHttpContent
Parameters
$encoded : string

JSON encoded content.

Return values
JsonHttpContent

Instance representing the provided content.

fromFile()

Creates an instance from an encoded file.

public static fromFile(string $path) : JsonHttpContent
Parameters
$path : string

Path to the JSON encoded file.

Return values
JsonHttpContent

Instance representing the provided path.

getContent()

Retrieves unencoded content.

public getContent() : mixed
Return values
mixed

Content.


        
On this page

Search results