Re: SetRequestMethod fails on XULRunner 9.0.1

Neil <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpfe
Message-ID <[email protected]>
[email protected] wrote:

>uploadChannel->SetUploadStream(postStream, NS_LITERAL_CSTRING("application/x-www-form-urlencoded"), -1);
>
>After setting the "SetUploadStream" It required to set "POST" method again because it is reseting the method to "PUT".
>  
>
If you want a POST another approach is to include the POST headers in 
the stream and pass an empty content type parameter.

>nsresult ww = ((nsIHttpChannel *)channel)->SetRequestMethod(NS_LITERAL_CSTRING("POST"));
>
>In above code "SetRequestMethod" API is getting failed and giving error NS_ERROR_NOT_AVAILABLE (0x80040111).
>  
>
I'm not sure why it would be returning that error, as it's not one of 
the four that I would expect. Perhaps your cast is unsafe?

-- 
Warning: May contain traces of nuts.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.