Don't forget to reset CUSTOMREQUEST on method change and defaults restore.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 13 Jan 2006 02:57:21 +0000 (02:57 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 13 Jan 2006 02:57:21 +0000 (02:57 +0000)
http_request_api.c
http_request_object.c

index 8c112497896f0ecc78fadf01bf3332c978ee5cb8..e949bf45beadefa93082e987d37f8b0687edf3e0 100644 (file)
@@ -391,6 +391,7 @@ PHP_HTTP_API void _http_request_defaults(http_request *request)
                HTTP_CURL_OPT(READDATA, NULL);
                HTTP_CURL_OPT(INFILESIZE, 0);
                HTTP_CURL_OPT(HTTP_VERSION, CURL_HTTP_VERSION_NONE);
+               HTTP_CURL_OPT(CUSTOMREQUEST, NULL);
        }
 }
 /* }}} */
index a9bd3bb12c3a436c92efb4275f4c8f93525dd276..ead0870361dd25e9e278f7a0d658548a3d13c5c7 100644 (file)
@@ -982,6 +982,11 @@ PHP_METHOD(HttpRequest, setMethod)
                RETURN_FALSE;
        }
 
+       if (meth >= HTTP_GET && meth <= HTTP_PUT) {
+               getObject(http_request_object, obj);
+               curl_easy_setopt(obj->request->ch, CURLOPT_CUSTOMREQUEST, NULL);
+       }
+
        UPD_PROP(long, method, meth);
        RETURN_TRUE;
 }