Response body after POST

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Response body after POST

Akmal Khodjanov
Hello all,

I'm new at netlib, so this question might look lame.
I looked at TestUpload.cpp (
http://lxr.mozilla.org/seamonkey/source/netwerk/test/TestUpload.cpp )
sample code to learn how to make POST methods using netlib. Can anybody
instruct me how I can get reponse body after POST has been finished?
I've successed to get reponse headers by adding code to OnStopRequest:

nsCOMPtr<nsIHttpChannel> pHTTPCon(do_QueryInterface(request));
if (pHTTPCon) {
        HeaderVisitor *visitor = new HeaderVisitor();
        if (!visitor)
                return NS_ERROR_OUT_OF_MEMORY;
        NS_ADDREF(visitor);
        printf("HTTP response headers:\n");
        pHTTPCon->VisitResponseHeaders(visitor);
        NS_RELEASE(visitor);
}

Any help is appreciated.
thanks.

-ak.
_______________________________________________
Mozilla-netlib mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-netlib
Reply | Threaded
Open this post in threaded view
|

Re: Response body after POST

Boris Zbarsky
Akmal Khodjanov wrote:
> Can anybody
> instruct me how I can get reponse body after POST has been finished?

You get it in the OnDataAvailable calls, no?

-Boris
_______________________________________________
Mozilla-netlib mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-netlib