Retrieve Edit metadata from the server. May also result in additional JavaScript settings and CSS/JS being loaded.
array $ids: An array of edit ids.
string The response body.
protected function retrieveMetadata($ids) {
// Build POST values.
$post = array();
for ($i = 0; $i < count($ids); $i++) {
$post['fields[' . $i . ']'] = $ids[$i];
}
// Serialize POST values.
foreach ($post as $key => $value) {
// Encode according to application/x-www-form-urlencoded
// Both names and values needs to be urlencoded, according to
// http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
$post[$key] = urlencode($key) . '=' . urlencode($value);
}
$post = implode('&', $post);
// Perform HTTP request.
return $this
->curlExec(array(
CURLOPT_URL => url('edit/metadata', array(
'absolute' => TRUE,
)),
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $post . $this
->getAjaxPageStatePostData(),
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Content-Type: application/x-www-form-urlencoded',
),
));
}