Trouble with HTTP OPTIONS request [CORS]


#1

Hi,

I’m trying to develop an API. This API is a plain standard JSON API following the standard specifications.

When I’m trying to consume my API from the same domain, no problems. When I’m trying to consume my API from another domain, the browser sends an OPTIONS request before the actual request (this is a normal behavior according to the CORS).

The problem is that my API doesn’t receive the OPTIONS request. It seems to be block somewhere between my computer and the server. I’m getting an net::ERR_EMPTY_RESPONSE.

Does anyone already encounter such behavior ?

As a side note, when both my application and my API are hosted on my machine (but on different server), I can actually check that my API fully support the CORS standard.


#2

Hi @Bartheleway!

000webhost does not allow OPTIONS method. Only GET / POST methods.

If you want more features please consider upgrading:


#3