curl --data-binary "{\"userid\":1234,\"friendlist\":[111,80010,80029,804189]}" "http://someurl.org/getuserinfo?appid=15&token=1382410267"
是否可以使用 php curl 扩展来执行此操作?
curl_setopt($this->_ch, CURLOPT_URL, $url);
curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($this->_ch, CURLOPT_TIMEOUT, 2.5);
curl_setopt($this->_ch, CURLOPT_POST, true);
curl_setopt($this->_ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($this->_ch, CURLOPT_POSTFIELDS, json_encode($postFields));
但不起作用