private function InstapageCmsPluginDrupal8Connector::prepareResponse in Instapage plugin 8.3
Same name and namespace in other branches
- 7.3 core/connectors/InstapageCmsPluginDrupal8Connector.php \InstapageCmsPluginDrupal8Connector::prepareResponse()
Prepares the remote request response to unify response object in all integrated CMSes.
Parameters
object $request Request result.:
Return value
array Standard Instapage plugin request response array.
1 call to InstapageCmsPluginDrupal8Connector::prepareResponse()
- InstapageCmsPluginDrupal8Connector::remoteRequest in core/
connectors/ InstapageCmsPluginDrupal8Connector.php - Performsremote request in a way specific for Drupal 7.
File
- core/
connectors/ InstapageCmsPluginDrupal8Connector.php, line 342
Class
- InstapageCmsPluginDrupal8Connector
- Class that utilizes native Drupal 8 functions to perform actions like remote requests and DB operations.
Code
private function prepareResponse($request) {
$headers = $request
->getHeaders();
$headers['set-cookie'] = isset($headers['Set-Cookie'][0]) ? $headers['Set-Cookie'][0] : '';
return array(
'body' => (string) $request
->getBody(),
'status' => $request
->getReasonPhrase(),
'code' => $request
->getStatusCode(),
'headers' => $headers,
);
}