我正在努力从响应头中提取X-Message-Id.谁能提供一个示例代码来获取这个X-Message-Id?
In my php:个
try {
$Response = $sendgrid->send($SgEmail);
print_r($Response->headers());
}
The SendGrid Response个
Array ( [0] => HTTP/1.1 202 Accepted [1] => Server: nginx [2] => Date: Fri, 22 Dec 2023 15:00:54 GMT [3] => Content-Length: 0 [4] => Connection: keep-alive [5] => X-Message-Id: BjsVqpBVTq63Z2fuITBUKw [6] => Access-Control-Allow-Origin: https://sendgrid.api-docs.io [7] => Access-Control-Allow-Methods: POST [8] => Access-Control-Allow-Headers: Authorization, Content-Type, On-behalf-of, x-sg-elas-acl [9] => Access-Control-Max-Age: 600 [10] => X-No-CORS-Reason: https://sendgrid.com/docs/Classroom/Basics/API/cors.html [11] => Strict-Transport-Security: max-age=600; includeSubDomains [12] => [13] => ) ('to','To_Name','Email@address.com')