我如何设置Php Curl Header授权 [英] How I Set Php Curl Header Authorization

查看:100
本文介绍了我如何设置Php Curl Header授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <pre lang="PHP">$ch = curl_init($url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:xml','Connection: close','Authorization:LOGIN=test,PASSWORD=f26fc9,REQUEST_GATEWAY_CODE=GW0001,REQUEST_
GATEWAY_TYPE=EXdfgdfgTGW,SERVICE_PORT=15590,SOURCE_TYPE=EdfgdfgXdfgTGW'));
        curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);    
	 curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
        curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); 

	 print("Send to BL:<BR>".$xml);

        $data = curl_exec($ch);





是正确的方法???我如何在php curl中编写这种类型的授权帮助



is that correct way ??? how i write this type of authorization in php curl plz help

推荐答案

ch = curl_init(
ch = curl_init(


url);
curl_setopt(
url); curl_setopt(


ch,CURLOPT_SSL_VERIFYHOST,0);
curl_setopt(
ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt(


这篇关于我如何设置Php Curl Header授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆