我有從捲曲 得到結果,但是當我嘗試調用C#的功能我從來沒有像PHP結果卻如何讓捲曲結果在C#
這是在PHP代碼PHP中的示例代碼
$url = "http://localhost/ws/init.php";
$ch=curl_init();
curl_setopt($ch, CURLOPT_POST ,1);
$header=array();
$header[]='Content-Type: application/json';
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
$data = json_encode($data);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result=curl_exec($ch);
curl_close($ch);
return $result;
這是從PHP結果
{"error_code":"0","error_desc":"","data":{"token":"xyx"}}
我嘗試使用libcurl.net,HttpClient的,WebRequest的,和Web客戶端爲獲得像PHP代碼結果卻 但直到現在我還是運氣不好 也許有人可以幫我解決這個問題?
我很感激與UR幫助傢伙
感謝您
[製作在C#中的捲曲電話]的可能的複製( https://stackoverflow.com/questions/7929013/making-a-curl-call-in-c-sharp) – chrisis