dpge74512
2013-04-23 14:28
浏览 193

在PHP cURL请求中转换C#HttpWebRequest

I'm new with cURL, I succeeded with my first request but now I'm stuck. I have the right request in C# but I don't know how to convert the second in cURL PHP.

Here is the HttpWebRequest:

var request = (HttpWebRequest)WebRequest.Create(new Uri("https://www.google.fr"));
request.Method = HttpMethod.Get;
request.Headers["X-343-Authorization-WLID"] = "v1=" + accessToken;
request.Accept = "application/json";

accessToken is a string variable of course.

图片转代码服务由CSDN问答提供 功能建议

我是cURL的新手,我成功完成了第一次请求,但现在我被卡住了。 我在C#中有正确的请求,但我不知道如何在cURL PHP中转换第二个。

这是HttpWebRequest:

 <  code> var request =(HttpWebRequest)WebRequest.Create(new Uri(“https://www.google.fr”)); 
request.Method = HttpMethod.Get; 
request.Headers [“X-343-Authorization-  WLID“] =”v1 =“+ accessToken; 
request.Accept =”application / json“; 
   
 
 

accessToken 是< 代码> string 变量当然。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题