Menu

## GraphResponse
in package

GraphResponse.php : 31

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

GraphResponse.php : 45

The body of the response

`private StreamInterface $_body`

#### $_decodedBody

GraphResponse.php : 52

The body of the response, decoded into an array

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

#### $_headers

GraphResponse.php : 58

The headers of the response

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

#### $_httpStatusCode

GraphResponse.php : 64

The status code of the response

`private int $_httpStatusCode`

#### $_request

GraphResponse.php : 39

The request object

`private object $_request`

### Methods

#### __construct()

GraphResponse.php : 74

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()

GraphResponse.php : 105

Get the decoded body of the HTTP response

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

##### Return values

array<string|int, mixed> —

The decoded body

#### getCount()

GraphResponse.php : 203

Gets the number of items in the response payload

`public getCount() : int|null`

##### Return values

int|null —

#### getDeltaLink()

GraphResponse.php : 190

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()

GraphResponse.php : 135

Get the headers of the response

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

##### Return values

array<string|int, mixed>|null —

The response headers

#### getNextLink()

GraphResponse.php : 175

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()

GraphResponse.php : 115

Get the undecoded body of the HTTP response

`public getRawBody() : string|null`

##### Return values

string|null —

The undecoded body

#### getResponseAsObject()

GraphResponse.php : 147

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()

GraphResponse.php : 125

Get the status of the HTTP response

`public getStatus() : int`

##### Return values

int —

The HTTP status

#### _decodeBody()

GraphResponse.php : 88

Decode the JSON response into an array

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

##### Return values

array<string|int, mixed> —

The decoded response

## Search results