From: Michael Wallner Date: Sat, 7 Jan 2006 17:41:48 +0000 (+0000) Subject: - avoid "Content-Length: 0" header on custom requests X-Git-Tag: RELEASE_1_0_4~12 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=e9dbd50bf2da38361ebbdca1c3a9fe24e5e4dc03;p=m6w6%2Fext-http - avoid "Content-Length: 0" header on custom requests --- diff --git a/http_request_api.c b/http_request_api.c index 84acf1c..082c5fc 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -629,22 +629,38 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti switch (request->meth) { case HTTP_GET: + HTTP_CURL_OPT(NOBODY, 0); + HTTP_CURL_OPT(POST, 0); + HTTP_CURL_OPT(UPLOAD, 0); HTTP_CURL_OPT(HTTPGET, 1); break; case HTTP_HEAD: + HTTP_CURL_OPT(POST, 0); + HTTP_CURL_OPT(UPLOAD, 0); + HTTP_CURL_OPT(HTTPGET, 0); HTTP_CURL_OPT(NOBODY, 1); break; case HTTP_POST: + HTTP_CURL_OPT(UPLOAD, 0); + HTTP_CURL_OPT(HTTPGET, 0); + HTTP_CURL_OPT(NOBODY, 0); HTTP_CURL_OPT(POST, 1); break; case HTTP_PUT: + HTTP_CURL_OPT(HTTPGET, 0); + HTTP_CURL_OPT(NOBODY, 0); + HTTP_CURL_OPT(POST, 0); HTTP_CURL_OPT(UPLOAD, 1); break; default: + HTTP_CURL_OPT(HTTPGET, 0); + HTTP_CURL_OPT(NOBODY, 0); + HTTP_CURL_OPT(POST, 0); + HTTP_CURL_OPT(UPLOAD, 0); if (http_request_method_exists(0, request->meth, NULL)) { HTTP_CURL_OPT(CUSTOMREQUEST, http_request_method_name(request->meth)); } else {