2013-10-13 114 views

回答

0

您是否通過NelmioApiDocBundle sanbox測試了您的api,還是從正面的表單發送數據?你確定你沒有發送csrf_protection requsest參數給你的api嗎?

+0

我使用curl從php調用api,並100%確定沒有發送csrf_protection。這裏是客戶端示例代碼 $ curl_post_data = json_encode($ curl_post_data); curl_setopt($ curl,CURLOPT_HTTPHEADER,array('Content-Type:application/json')); curl_setopt($ curl,CURLOPT_RETURNTRANSFER,true); curl_setopt($ curl,CURLOPT_POST,true); curl_setopt($ curl,CURLOPT_POSTFIELDS,$ curl_post_data); $ curl_response = curl_exec($ curl); – Bads123