Reputation: 389
I'm having a problem using the Request Builder on GWT.
I'm using a local server (Apache) configured with a Reverse Proxy (so I don't have problems making cross domain calls). When I run my GWT project in production mode, the calls are made just fine.
However, in development mode, I'm having trouble doing so - it seems that every POST request I make is somehow turned into a OPTIONS one, so I never get the response I want.
Right now I'm quite at loss. If the calls work fine on production mode, then the problem isn't with my Apache configuration nor with my GWT code, right? I'm assuming that the problem is with the development mode configuration, but I can't find any information on that. The rest of my project works fine on both modes.
Upvotes: 0
Views: 601
Reputation: 64561
If you're not running DevMode off your server in -noserver
mode, then your browser is simply following CORS, which mandates checking with OPTIONS
if a cross-origin POST
is allowed before actually doing it.
Try it in IE and you'll hit the Same-Origin Policy instead (as IE doesn't implement CORS on XMLHttpRequest
, but on a IE-specific XDomainRequest
that GWT doesn't try to deal with –too much runtime overhead for something [cross-origin requests] that's very rarely used and that everyone thinks IE should fix instead–).
Upvotes: 1