In Drupal 7 verwende ich den folgenden Code.
$url = 'testdomain/url';
$response = drupal_http_request($url, array('method' => 'POST', 'headers' => array('Content-Type' => 'application/x-www-form-urlencoded; charset=utf-8')));
if ($response->code == "200") {
$result = $response->data;
}
Was ist der entsprechende Code, den ich für Drupal 8 verwenden sollte?