Documentation

GraphResponse
in package

Class GraphResponse

Tags
category

Library

license

https://opensource.org/licenses/MIT MIT License

link
https://graph.microsoft.io/

Table of Contents

$_body  : StreamInterface
The body of the response
$_decodedBody  : array<string|int, mixed>|(string)
The body of the response, decoded into an array
$_headers  : array<string|int, mixed>|(string)
The headers of the response
$_httpStatusCode  : int
The status code of the response
$_request  : object
The request object
__construct()  : mixed
Creates a new Graph HTTP response entity
getBody()  : array<string|int, mixed>
Get the decoded body of the HTTP response
getCount()  : int|null
Gets the number of items in the response payload
getDeltaLink()  : string|null
Gets the delta link of a response object from OData If the deltaLink is null, there are more pages in the collection; use nextLink to obtain more
getHeaders()  : array<string|int, mixed>|null
Get the headers of the response
getNextLink()  : string|null
Gets the next link of a response object from OData If the nextLink is null, there are no more pages
getRawBody()  : string|null
Get the undecoded body of the HTTP response
getResponseAsObject()  : mixed
Converts the response JSON object to a Graph SDK object
getStatus()  : int
Get the status of the HTTP response
_decodeBody()  : array<string|int, mixed>
Decode the JSON response into an array

Properties

$_body

The body of the response

private StreamInterface $_body

$_decodedBody

The body of the response, decoded into an array

private array<string|int, mixed>|(string) $_decodedBody

$_headers

The headers of the response

private array<string|int, mixed>|(string) $_headers

$_httpStatusCode

The status code of the response

private int $_httpStatusCode

Methods

__construct()

Creates a new Graph HTTP response entity

public __construct(GraphRequest $request[, StreamInterface|null $body = null ], int $httpStatusCode[, array<string|int, mixed> $headers = [] ]) : mixed
Parameters
$request : GraphRequest

The request

$body : StreamInterface|null = null

The body of the response

$httpStatusCode : int

The returned status code

$headers : array<string|int, mixed> = []

The returned headers

Return values
mixed

getBody()

Get the decoded body of the HTTP response

public getBody() : array<string|int, mixed>
Return values
array<string|int, mixed>

The decoded body

getCount()

Gets the number of items in the response payload

public getCount() : int|null
Return values
int|null

Gets the delta link of a response object from OData If the deltaLink is null, there are more pages in the collection; use nextLink to obtain more

public getDeltaLink() : string|null
Return values
string|null

deltaLink

getHeaders()

Get the headers of the response

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

The response headers

Gets the next link of a response object from OData If the nextLink is null, there are no more pages

public getNextLink() : string|null
Return values
string|null

nextLink, if provided

getRawBody()

Get the undecoded body of the HTTP response

public getRawBody() : string|null
Return values
string|null

The undecoded body

getResponseAsObject()

Converts the response JSON object to a Graph SDK object

public getResponseAsObject(mixed $returnType) : mixed
Parameters
$returnType : mixed

The type to convert the object(s) to // *

Return values
mixed

object or array of objects of type $returnType

getStatus()

Get the status of the HTTP response

public getStatus() : int
Return values
int

The HTTP status

_decodeBody()

Decode the JSON response into an array

private _decodeBody() : array<string|int, mixed>
Return values
array<string|int, mixed>

The decoded response

Search results