Index Documentation

StringHttpContent
in package
implements HttpContent

Represents string body content for a HTTP message.

Table of Contents

Interfaces

HttpContent
Represents the body content for a HTTP message.

Methods

__construct()  : mixed
__toString()  : string
fromFile()  : StringHttpContent
Creates an instance from a file.
fromObject()  : StringHttpContent
Creates an instance an existing object.
fromRequest()  : StringHttpContent
Creates an instance from the raw request body.
getString()  : string
Retrieves the underlying string.

Methods

__construct()

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

String that represents this message body.

fromObject()

Creates an instance an existing object.

public static fromObject(Stringable|string $string) : StringHttpContent
Parameters
$string : Stringable|string

Object to cast to a string.

Return values
StringHttpContent

Instance representing the provided object.

getString()

Retrieves the underlying string.

public getString() : string
Return values
string

Underlying string.


        
On this page

Search results