ResponseReceivedEvent
extends ShipEngineEvent
in package
implements
JsonSerializable
Class ResponseReceivedEvent
Interfaces, Classes and Traits
- JsonSerializable
Table of Contents
- RESPONSE_RECEIVED = 'response_received'
- The event name for the ResponseReceivedEvent.
- $body : array<string|int, mixed>
- An associative array representation of the response body.
- $elapsed : DateInterval
- This is the elapsed time between the `RequestSentEvent` and the `ResponseReceivedEvent`.
- $headers : array<string|int, mixed>
- An array of request headers that was sent on the request that triggered this event.
- $message : string
- The event message to provide context to the underlying event.
- $requestId : string
- The requestId that corresponds to the request that was sent when this event is emitted.
- $retry : int
- The current retry - this is used in the retry logic that the ShipEngineClient executes.
- $statusCode : int
- The response status code.
- $timestamp : DateTime
- The timestamp of when the event was emitted.
- $type : string
- The type of event being emitted.
- $url : string
- This is the URL that the request was sent to.
- __construct() : mixed
- ResponseReceivedEvent constructor - this event is emitted when a response is received by the ShipEngineClient, from the target server.
- jsonSerialize() : mixed
- Specify data which should be serialized to JSON
Constants
RESPONSE_RECEIVED
The event name for the ResponseReceivedEvent.
public
mixed
RESPONSE_RECEIVED
= 'response_received'
Tags
Properties
$body
An associative array representation of the response body.
public
array<string|int, mixed>
$body
$elapsed
This is the elapsed time between the `RequestSentEvent` and the `ResponseReceivedEvent`.
public
DateInterval
$elapsed
Tags
$headers
An array of request headers that was sent on the request that triggered this event.
public
array<string|int, mixed>
$headers
$message
The event message to provide context to the underlying event.
public
string
$message
$requestId
The requestId that corresponds to the request that was sent when this event is emitted.
public
string
$requestId
$retry
The current retry - this is used in the retry logic that the ShipEngineClient executes.
public
int
$retry
$statusCode
The response status code.
public
int
$statusCode
$timestamp
The timestamp of when the event was emitted.
public
DateTime
$timestamp
$type
The type of event being emitted.
public
string
$type
$url
This is the URL that the request was sent to.
public
string
$url
Methods
__construct()
ResponseReceivedEvent constructor - this event is emitted when a response is received by the ShipEngineClient, from the target server.
public
__construct(string $message, string $requestId, string $url, int $statusCode, array<string|int, mixed> $headers, array<string|int, mixed> $body, int $retry, DateInterval $elapsed) : mixed
Parameters
- $message : string
- $requestId : string
- $url : string
- $statusCode : int
- $headers : array<string|int, mixed>
- $body : array<string|int, mixed>
- $retry : int
- $elapsed : DateInterval
Return values
mixed —jsonSerialize()
Specify data which should be serialized to JSON
public
jsonSerialize() : mixed