美文网首页
raw数据传输

raw数据传输

作者: Stonesy | 来源:发表于2020-10-13 11:50 被阅读0次
public function http_post($url, $data_string) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        
        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'X-AjaxPro-Method:ShowList',
        'Content-Type: application/json; charset=utf-8',
        'Content-Length: ' . strlen($data_string))
        );
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
        $data = curl_exec($ch);
        curl_close($ch);
        return $data;
        }

相关文章

网友评论

      本文标题:raw数据传输

      本文链接:https://www.haomeiwen.com/subject/swhvpktx.html