Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #17845 > unrolled thread

ajax cross domain request by POST method with content type application/json skipping preflight OPTIONS request

Started bydmitry.steblyuk@axibase.com
First post2012-12-27 04:45 -0800
Last post2012-12-27 12:03 -0800
Articles 2 — 2 participants

Back to article view | Back to comp.lang.javascript


Contents

  ajax cross domain request by POST method with content type application/json skipping preflight OPTIONS request dmitry.steblyuk@axibase.com - 2012-12-27 04:45 -0800
    Re: ajax cross domain request by POST method with content type application/json skipping preflight OPTIONS request Danny <dann90038@gmail.com> - 2012-12-27 12:03 -0800

#17845 — ajax cross domain request by POST method with content type application/json skipping preflight OPTIONS request

Fromdmitry.steblyuk@axibase.com
Date2012-12-27 04:45 -0800
Subjectajax cross domain request by POST method with content type application/json skipping preflight OPTIONS request
Message-ID<8e690182-3d15-4c62-be52-bdbd0109c975@googlegroups.com>
I there a way to do this?

The problem is server doesn't respond header

Access-Control-Allow-Headers: content-type

But i need to specify content-type: application/json
As a consequence, when browser send preflight options request, i have message error in console like this

Request header field Content-Type is not allowed by Access-Control-Allow-Headers

When i use Postman(chrome extension) and send the same post request to the same server, then all fine: in network tab i don't see preflight options request, but only one post request with status OK. I copied my javascript code, which send this request, into the console in open Postman page. I invoke it and then all fine too. Why in Postman page preflight request is omitted? How they to this?

Thanks a lot for any advance!

Dmitry

[toc] | [next] | [standalone]


#17847

FromDanny <dann90038@gmail.com>
Date2012-12-27 12:03 -0800
Message-ID<c957348b-f827-40e8-8f7f-90a046b597fd@googlegroups.com>
In reply to#17845
> Dmitry

I'd think you may want to provide a url for this page with the issue, and also to specify a bit more.

Not sure I follow you, from what you posted all I can make is that some XMLHttpRequest() object is being blocked by the Apache webserver settings upon issuing some arguments on its open() method.

I'm assuming you're not asking about Server-Side Javascript or an Apache matter

Not sure many folks here may know what a 'preflight option' is by the way :|

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web