2017-03-11 16:17:16 8136次浏览 2条回答 0 悬赏 20 金钱

https://github.com/linslin/Yii2-Curl/tree/master
我想发起get请求设置header 和 编码格式为utf8

补充于 2017-03-11 16:20
  • 回答于 2017-03-12 13:44 举报
    1 条回复
    回复于 2017-03-13 14:18 回复

    这个我有看,但是我没看懂里面调用的方法

    /**
     * cURL POST example with post body params.
     */
    public function actionPostExample()
    {
        //Init curl
        $curl = new curl\Curl();
    
        //post http://example.com/
        $response = $curl->setOption(
                CURLOPT_POSTFIELDS, 
                http_build_query(array(
                    'myPostField' => 'value'
                )
            ))
            ->post('http://example.com/');
    }
    

    而且我调用 setHeaders 方法 会报错

  • 回答于 2017-03-14 12:51 举报

    QQ图片20170314125044.png

    觉得很赞
您需要登录后才可以回答。登录 | 立即注册
acking
总监

acking 上海

注册时间:2012-05-16
最后登录:2天前
在线时长:65小时39分
  • 粉丝13
  • 金钱2555
  • 威望0
  • 积分3205

热门问题