diff --git a/content/base/public/nsIXMLHttpRequest.idl b/content/base/public/nsIXMLHttpRequest.idl index 8ca146169647..e43a22a6271a 100644 --- a/content/base/public/nsIXMLHttpRequest.idl +++ b/content/base/public/nsIXMLHttpRequest.idl @@ -149,8 +149,8 @@ interface nsIXMLHttpRequest : nsISupports { * the request is not sent until the send method * is invoked. * - * @param method The HTTP method - either "POST" or "GET". Ignored - * if the URL is not a HTTP URL. + * @param method The HTTP method, for example "POST" or "GET". Ignored + * if the URL is not a HTTP(S) URL. * @param url The URL to which to send the request. * @param async Whether the request is synchronous or asynchronous * i.e. whether send returns only after the response diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 90c829d0287f..86e443c966d0 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -1041,6 +1041,10 @@ nsXMLHttpRequest::Send(nsIVariant *aBody) NS_ASSERTION(uploadChannel, "http must support nsIUploadChannel"); rv = uploadChannel->SetUploadStream(postDataStream, nsnull, -1); + // Reset the method to its original value + if (httpChannel) { + httpChannel->SetRequestMethod(method); + } } }