PHP cURL, POST JSON

后端 未结 5 2279
南方客
南方客 2020-11-28 13:48

I need to POST the following JSON code, but for some reason it is not working. Below is the code that I have.

$fieldString = \"395609399\";
//the curl reques         


        
5条回答
  •  没有蜡笔的小新
    2020-11-28 14:21

    Send your text without JSON encoding, and add this header code:

    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json; charset=utf-8","Accept:application/json, text/javascript, */*; q=0.01")); 
    

提交回复
热议问题