[webkit-dev] problem with ajax POSTs generated from Webkit

Steve Conover sconover at gmail.com
Wed Feb 18 23:11:51 PST 2009


Hi everyone,

This is definitely Cocoa-specific, but I'm hoping this is a good group
to put this question to.  Even if nobody knows the answer to my
specific problem, I'm particularly interested in suggestions around
what you'd hook into or override, even if it's webkit-specific, to
intercept all resource load requests (loading files, handling ajax and
form posts and page loads,  etc) to provide your own request-handling
implementation.



I'm attempting to put my own NSURLProtocol in place to handle requests
generated from web pages I load through the Cocoa Webkit API.

When I kick off an ajax POST from my webpage and see what comes
through in my Protocol, it's an NSURLRequest (not NSMutableURLRequest)
with nil HTTPBody, HTTPBodyStream, and HTTPBodyStreamForTransmission
properties.  The post body is nowhere to be seen.  Where should I be
looking?

I do notice that when I do a POST via an html form the request object
is a NSMutableURLRequest with the appropriate post body.

Should ajax requests be coming through just like other requests?  Is
this (the NSURLProtocol) the appropriate place to be overriding
request/connection infrastructure and providing my own implementation,
or is there some other more appropriate place to be doing this?

Thanks for your patience, I'm pretty new at Webkit/Cocoa.

Regards,
Steve


More information about the webkit-dev mailing list