class OAuthRequest

This class represents an outgoing OAuth request to be sent to an OAuth provider.

Properties

private string $url Url of the endpoint of the OAuth provider
private string $method HTTP method for the request
private array $headers The request-header fields to pass additional information about the request, and about the client itself, to the provider.
private string $body The optional request body content

Methods

__construct(string $url, string $method, array $headers = [], string|null $body = null)

Constructs a OAuth request object

string
getUrl()

Returns the url of the endpoint of the OAuth provider

string
getMethod()

Returns the HTTP method for the request

array
getHeaders()

Returns the request-header fields

string
getBody()

Returns the body content of the request

setUrl(string $url)

Sets the url of the endpoint of the OAuth provider

setMethod(string $method)

Sets the HTTP method for the request

setHeaders(array $headers)

Sets the request-header fields

setBody(string $body)

Sets the body content of the request

Details

at line 48
__construct(string $url, string $method, array $headers = [], string|null $body = null)

Constructs a OAuth request object

Parameters

string $url url of the endpoint of the OAuth provider
string $method HTTP method for the request.
array $headers headers for the message.
string|null $body the body content of the request.

at line 60
string getUrl()

Returns the url of the endpoint of the OAuth provider

Return Value

string the url of the endpoint

at line 69
string getMethod()

Returns the HTTP method for the request

Return Value

string the HTTP method

at line 78
array getHeaders()

Returns the request-header fields

Return Value

array the request-header fields

at line 87
string getBody()

Returns the body content of the request

Return Value

string the body content

at line 98
OAuthRequest setUrl(string $url)

Sets the url of the endpoint of the OAuth provider

Parameters

string $url the url of the endpoint

Return Value

OAuthRequest

at line 110
OAuthRequest setMethod(string $method)

Sets the HTTP method for the request

Parameters

string $method the HTTP method

Return Value

OAuthRequest

at line 122
OAuthRequest setHeaders(array $headers)

Sets the request-header fields

Parameters

array $headers the request-header fields

Return Value

OAuthRequest

at line 134
OAuthRequest setBody(string $body)

Sets the body content of the request

Parameters

string $body the body content

Return Value

OAuthRequest