Xcom::getDebugOutput
Xcom::getLastResponseInfo
Xcom
PHP Manual

# Xcom::getLastResponse

(PECL xcommerce >= 1.0.0)

Xcom::getLastResponse — Get the last response body

### Opis

public string Xcom::getLastResponse ( void )

Fetch the body of the last response. Mostly useful when debugging error messages, often times the reason for a failure is documentated in the response body (ie, Invalid Token, bad HTTP method, etc.)

### Parametry

Ta funkcja nie posiada parametrów.

### Zwracane wartości

Returns a string containing the last response.

### Przykłady

Przykład #1 Xcom::getLastResponse() example

`<?php
$data = 'foo';
$xcom = new Xcom(XCOM_FABRIC_SANDBOX, "fabric_token", "an_invalid_token");
$xcom->send("/com.x.example.v1/OrderFulfillment/OrderShipped", $data);
echo "I failed because: " . $xcom->getLastResponse();
?>`

Xcom::getDebugOutput
Xcom::getLastResponseInfo
Xcom
PHP Manual