On Tue, Jun 15, 2010 at 5:20 PM, b a <[email protected]> wrote:

> Hi Ilkka,
>
> On 6/15/10, Ilkka Oksanen <[email protected]> wrote:
> > Hi,
> >
> > On Tue, Jun 15, 2010 at 3:21 PM, b a <[email protected]> wrote:
> >
> >> Hi,
> >>
> >> I started writing something with qooxdoo and I also wrote a server
> >> so that the qooxdoo app communicates with that.
> >>
> >> In qooxdoo I made a POST request like this
> >>
> >>                var req = new qx.io.remote.Request(
> >>                        "http://127.0.0.1:8124";,
> >>                        "POST",
> >>                        "application/json");
> >>
> >> And in the server I printed all Request methods of incoming requests.
> >> I expected to get a "POST" request on the server, but in *reality* ... I
> >> got
> >> an "OPTIONS" request.
> >>
> >>
> > That OPTIONS request is not related to Qooxdoo. Some browser use it to
> learn
> > the additional features that the web server supports. OPTIONS is part of
> the
> > HTTP standard.
> >
> > You can safely configure your server app to respond "HTTP/1.1. 501 Not
> > implement" to such requests. In fact 501 should be the default answer to
> all
> > unknown requests.
>
> I'm afraid I cannot do that since I was expecting a POST and not
> OPTIONS on serverside.
> Also, I intend to take data from the POST request and provide a
> response to the client.
> But your 501 suggestions is interesting and may be useful, only not in my
> case.
>
>
That doesn't sound very robust server implementation. If your server would
send an answer to OPTIONS probe (even just 501 or 200) web browser would
immediately sent the POST request you want to receive.

I read quickly some node.js documentation and looks like adding support for
OPTIONS would not be impossible. Something like "if (request.method ==
"OPTIONS") { ... } else { <processing for POST/GET> }" should work in
request handler.

              -ilkka
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to