更具体地说,这是我在目标 c 中需要做的,这相当于什么?
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL,"api.example.com");
curl_setopt($ch, CURLOPT_POSTFIELDS, "a message to the site");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST,"GET" );
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: Application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
curl_close ($ch);