Yes, the format in the manual is not recommended
<code>CURLOPT_HTTPHEADER 设置 HTTP 头字段的数组。格式: array('Content-type: text/plain', 'Content-length: 100') --- $head = array('Request-Id' => '1w11'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); </code>
It is recommended to put it directly in data
<code><?php $ch = curl_init(); $data = array('Request-Id' => '1w11'); curl_setopt($ch, CURLOPT_URL, 'http://localhost/this.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_exec($ch); ?></code>
No. Can you tell me why you do this?
Just try it yourself and see if it works.
It should be possible. Google’s APIs are all there.
If it still doesn’t work, just build an http protocol format yourself and enable TCP transmission.