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:

141 questions
14
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,937
  • 3
  • 19
  • 41
14
votes
4 answers

Spring boot REST service options 401 on OAuth /token

I'm using Spring Boot to make a simple rest service. To consume it in Angular 2, I've got CORS problem when retrieving token on OAuth /token endpoint. The error message in Chrome is below. error message: zone.js:101 OPTIONS…
weijun
  • 165
  • 1
  • 1
  • 6
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,652
  • 12
  • 61
  • 98
11
votes
2 answers

nginx: Do not require Basic Authentication only if http request is OPTIONS

The Authorization Header is not sent with an HTTP OPTIONS Request. I would like disable this authentication only when the request is OPTIONS and leave it on for other requests. Here is the relevant piece of config code I have at the moment. cannot…
Vincent Gagnon
  • 650
  • 2
  • 7
  • 15
10
votes
2 answers

AngularJS - how to disable OPTION request?

I noticed that my Angular is creating OPTIONS request also before each POST request. I'm using custom API Service for HTTP request handling. app.service('ApiService', function ($http) { /** * Process remote POST request to give URL with given…
redrom
  • 11,502
  • 31
  • 157
  • 264
9
votes
2 answers

Is it possible to cache HTTP OPTIONS response?

I am making CORS calls. Now, every api call has a OPTIONS preflight call. Is it possible to cache the OPTIONS preflight call? I see that Cache-Control header can be used to cache actual GET response. https://www.fastly.com/blog/caching-cors But how…
codefx
  • 9,872
  • 16
  • 53
  • 81
9
votes
4 answers

What HTTP response code should be used for an OPTION request?

I noticed that the Mozilla HTTP response codes documentation states that The methods PUT, DELETE, and OPTIONS can never result in a 200 OK response. However it doesn't make clear what response should actually be used. My best guess would be 204:…
Joshua
  • 6,320
  • 6
  • 45
  • 62
8
votes
3 answers

How do I configure embedded Jetty to handle OPTIONS preflight requests?

I am working on a project which is using embedded Jetty (unfortunately I just "inherited" the server side of the project and am not very familiar with the use of Jetty and its configuration). An odd case just popped up - I'll do my best to…
Jer
  • 5,468
  • 8
  • 34
  • 41
8
votes
2 answers

Entry point to REST/HATEOAS API?

I have started designing an API and have decided to have a go at making it conform to REST/HATEOAS. What should the entry point for the API be? It seems like a common one is GET / but from what I've read it might make more sense logically to use…
DanielGibbs
  • 9,910
  • 11
  • 76
  • 121
8
votes
1 answer

Should a HTTP Allow header contain "OPTIONS"?

If a HTTP resource is not able to handle a request with the given HTTP method, it should send an Allow header to list the allowed HTTP methods. Another possibility to get a response with an Allow header is to send a request with the OPTIONS…
deamon
  • 89,107
  • 111
  • 320
  • 448
8
votes
3 answers

Why is ExtJS sending an OPTIONS request to the same domain?

I'm loading my script on a domain and sending some data with POST and the use of Ext.Ajax.request() to that same domain. Somehow the dev-tools show me, that there is a failed OPTIONS request. Request URL :…
K..
  • 4,044
  • 6
  • 40
  • 85
7
votes
1 answer

Http Option Method with Javascript request

I use backbone.js' s model. When i save the model, it sends HTTP OPTIONS method to server-side on firefox, but sends HTTP POST method with safari. I know it is not an issue about backbone.js, it is about CORS. I will just check if method, GET, POST,…
Mehmet Davut
  • 667
  • 10
  • 30
7
votes
0 answers

RESTful API authorization/permissions using OPTIONS

Are HTTP OPTIONS requests appropriate to determine a user's authorization? I have seen HTTP OPTIONS requests used for preflight to check if a request is valid, but is it okay to use it to determine what access a user has to a specific resource? Use…
7
votes
1 answer

WebAPI CORS - why is the OPTIONS request making its way into my Controller?

I have CORS working with the following: [System.Web.Http.HttpPut] [System.Web.Http.AcceptVerbs("OPTIONS")] [System.Web.Http.Route("api/exercise")] public HttpResponseMessage UpdateExercise(Exercise exercise) { try { …
SB2055
  • 12,272
  • 32
  • 97
  • 202
6
votes
1 answer

(Mobile) Browser support for Cross-Origin Resource Sharing?

I'm building a site that uses w3c CORS to make oAuth-signed HTTP requests to a remote server. Mozilla has a great document explaining how to make and receive CORS requests, and there's good support in firefox, chrome, and safari. Does anyone…
Bosh
  • 8,138
  • 11
  • 51
  • 77
1
2
3
9 10