scrapy / scrapyd

A service daemon to run Scrapy spiders
https://scrapyd.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
2.93k stars 571 forks source link

Expected one of [b'HEAD', b'object', b'POST'] when sending pre-flight OPTIONS request #391

Closed gymcoding closed 2 months ago

gymcoding commented 3 years ago

The following error occurs when you request http://localhost:6800/schedule.json with Axios:

Error Message

Expected one of [b'HEAD, b'object, b'POST']

The cause is an error caused by pre-flight (OPTIONS) prior to POST request.

How should I handle this?

Digenis commented 3 years ago

If it's not returning 405, it's a scrapyd or twisted bug.

If it's returning 405, its an axios bug.

In any case, if this method is useful, feel free to open a pull request and add it to the webservice

jhoanborges commented 2 years ago

+1 image

jpmckinney commented 2 years ago

FYI, there are some links here in an axios issue to avoid sending the OPTIONS request (or to have it swallowed by a proxy): https://github.com/axios/axios/issues/888