cURL / Mailing Lists / curl-library / Single Mail

curl-library

Http Delete request return 400

From: huancong deng <denghuancong_at_gmail.com>
Date: Wed, 7 Nov 2012 14:59:30 +0800

 82 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
 83 curl_easy_setopt(curl,CURLOPT_CUSTOMREQUEST,"delete");
 84 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,&http_callback);
 85 curl_easy_setopt(curl, CURLOPT_URL,"
http://ucenter.local.ucloud.cn/api/aiotest/test");
 86
//curl_easy_setopt(curl,CURLOPT_POSTFIELDS,"username=huancong&password=doyou");
 87 res = curl_easy_perform(curl);
the server return :
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.2.4</center>
</body>
</html>
==================================================================
but, when i use curl command in centos,it return well.
[ucdn_at_u201 test]$ curl -X DELETE
http://ucenter.local.ucloud.cn/api/aiotest/test
<?xml version="1.0" encoding="utf-8"?>
<xml><feedback>hi, delete
response.</feedback><api_params><username></username><password></password></api_params></xml>
[ucdn_at_u201 test]$

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-07