Điều này làm việc với tôi, gửi một tệp XML bằng \ Drupal :: httpClient () POST
$endpoint  = 'http://example.com/something';
$xml = '<>'; // You're XML here.
// Make the request.
$options = [
  'connect_timeout' => 30,
  'debug' => true,
  'headers' => array(
    'Content-Type' => 'text/xml',
  ),
  'body' => $xml,
  'verify'=>true,
];
try {
  $client = \Drupal::httpClient();
  $request = $client->request('POST',$endpoint,$options);
}
catch (RequestException $e){
  // Log the error.
  watchdog_exception('custom_modulename', $e);
}
$responseStatus = $request->getStatusCode();
$responseXml = $request->getBody()->getContents();
Hi vọng điêu nay co ich.
Thông tin thêm về Guheads tại đây: http://docs.guheadsphp.org/en/latest/index.html