Questions tagged [http-options-method]

The HTTP OPTIONS request method is commonly used to ask a Web server which HTTP methods the server allows; servers typically respond with just a set of headers that includes the Allow header, whose value lists the allowed methods. The OPTIONS method is also a key part of the CORS protocol.

See also:

108 questions
304
votes
10 answers

Why am I getting an OPTIONS request instead of a GET request?

it does an OPTIONS request to that URL, and then the…
Paul Tarjan
  • 44,540
  • 54
  • 163
  • 207
66
votes
5 answers

HTTP protocol's PUT and DELETE and their usage in PHP

Introduction I've read the following: Hypertext Transfer Protocol (HTTP) is the life of the web. It's used every time you transfer a document, or make an AJAX request. But HTTP is surprisingly a relative unknown among some web developers. The HTTP…
user4446130
31
votes
3 answers

How to handle HTTP OPTIONS requests in Spring Boot?

First off, I've read "How to handle HTTP OPTIONS with Spring MVC?" but the answers do not seem directly applicable to Spring Boot. It looks like I should do this: configure the dispatcherServlet by setting its dispatchOptionsRequest to true But…
Jonik
  • 74,291
  • 66
  • 249
  • 356
30
votes
2 answers

Handling OPTIONS request in nginx

We're using HAProxy as a load balancer at the moment, and it regularly makes requests to the downstream boxes to make sure they're alive using an OPTIONS request: OPTIONS /index.html HTTP/1.0 I'm working with getting nginx set up as a reverse…
ctmiller
  • 301
  • 1
  • 4
  • 6
28
votes
5 answers

How to handle HTTP OPTIONS with Spring MVC?

I'd like to intercept the OPTIONS request with my controller using Spring MVC, but it is catched by the DispatcherServlet. How can I manage that?
MaVVamaldo
  • 2,425
  • 5
  • 26
  • 48
22
votes
5 answers

Problem sending JSON data from JQuery to WCF REST method

I'm having some trouble getting jquery to post some json data to a rest method I have on my WCF service. On the WCF side, here's the operation contract: [OperationContract] [WebInvoke(Method = "POST", BodyStyle =…
theburningmonk
  • 14,865
  • 12
  • 57
  • 103
17
votes
2 answers

HTTP OPTIONS error in Phil Sturgeon's Codeigniter Restserver and Backbone.js

My backbone.js application throwing an HTTP OPTIONS not found error when I try to save a model to my restful web service that's located on another host/URL. Based on my research, I gathered from this post that : a request would constantly send an…
16
votes
1 answer

Access-Control-Allow-Origin header not working - What am I doing wrong?

I am attempting to provide a response to the HTTP OPTIONS method with an Access-Control-Allow-Origin header copying the contents of the Origin header in the request. This is apparently not working, for reasons I can't figure out. tl;dr: response…
scav
  • 1,005
  • 1
  • 9
  • 16
14
votes
6 answers

how to handle "OPTIONS Method" in ASP.NET MVC

My Sencha Touch app is posting a form to my asp.net-mvc-3 WebService, but instead of sending POST it's sending OPTIONS. I'm reading a similar thread here, but I just don't know how to handle the OPTIONS method in my code. I did try adding the…
Chase Florell
  • 42,985
  • 56
  • 169
  • 364
13
votes
2 answers

Getting 404 Not Found on OPTIONS with NestJS

I'm new to NestJS and on every route my web app is trying to query, it fails on the OPTIONS request, getting: {"statusCode":404,"error":"Not Found","message":"Cannot OPTIONS /authenticate"} however trying a direct GET or POST request works fine.
Francesco Borzi
  • 37,945
  • 31
  • 126
  • 195
13
votes
2 answers

How to solve ASP.NET Web API CORS Preflight issue when using PUT and DELETE requests with multiple origins?

I have an ASP.NET web API that is being called by three different SPA. I am using windows authentication for the web API. I initially tried to configure CORS in the Web.config like this:
João Paiva
  • 1,672
  • 3
  • 16
  • 33
13
votes
1 answer

OPTIONS request authentication

I am developing a web application. It is using Basic authentication. It must process OPTIONS requests. These are web browser preflight requests as well as feature-support requests from WebDAV clients. As far as I understand OPTIONS request must be…
IT Hit WebDAV
  • 5,041
  • 12
  • 50
  • 88
13
votes
1 answer

How to respond to OPTIONS HTTP Method in rails-api?

I'm using rails-api to build a public json api. I would like to respond to OPTIONS HTTP Method to take advantages of Cross-Origin Resource Sharing. http://www.w3.org/TR/cors/ I'm doing this: headers['Access-Control-Allow-Methods'] = 'POST, PUT,…
yokomizor
  • 1,407
  • 1
  • 18
  • 19
13
votes
2 answers

How to handle "OPTIONS *" request in nginx?

In my environment, I use perlbal to redirect request to nginx. If verify_backend is on. perbal will send a "OPTIONS *" request to nginx, but the nginx response it as a bad request. According to RFC2616: If the Request-URI is an asterisk (""), the…
Cody
  • 3,910
  • 3
  • 34
  • 39
13
votes
3 answers

Can an HTTP OPTIONS request return a 204 or should it always return 200?

According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2 the only response ever mentioned regarding an HTTP OPTIONS request is a 200. However, there seem to be cases such as when the content-length is 0 that a 204 would be more…
user1675009
  • 155
  • 1
  • 1
  • 6
1
2 3 4 5 6 7 8