protected function RemotePostWebformHandler::getResponseData in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformHandler/RemotePostWebformHandler.php \Drupal\webform\Plugin\WebformHandler\RemotePostWebformHandler::getResponseData()
Get response data.
Parameters
\Psr\Http\Message\ResponseInterface $response: The response returned by the remote server.
Return value
array|string An array of data, parse from JSON, or a string.
3 calls to RemotePostWebformHandler::getResponseData()
- RemotePostWebformHandler::debug in src/
Plugin/ WebformHandler/ RemotePostWebformHandler.php - Display debugging information.
- RemotePostWebformHandler::displayCustomResponseMessage in src/
Plugin/ WebformHandler/ RemotePostWebformHandler.php - Display custom response message.
- RemotePostWebformHandler::remotePost in src/
Plugin/ WebformHandler/ RemotePostWebformHandler.php - Execute a remote post.
File
- src/
Plugin/ WebformHandler/ RemotePostWebformHandler.php, line 829
Class
- RemotePostWebformHandler
- Webform submission remote post handler.
Namespace
Drupal\webform\Plugin\WebformHandlerCode
protected function getResponseData(ResponseInterface $response) {
$body = (string) $response
->getBody();
$data = json_decode($body, TRUE);
return json_last_error() === JSON_ERROR_NONE ? $data : $body;
}