Reputation: 4960
Is there any ways to do this using jquery without redundant OPTIONS request?
P.S. By the way, what is the great mission of such workflow?
Upvotes: 0
Views: 778
Reputation: 4960
So, now it is obviously that OPTIONS can be usefull, but in a bit strange (in my opinion) manner.
All PUT and DELETE queries, and queries with modified headers are preflight with such request. The great mission is in checking resource availability for providing some kind of operation.
For example, let consider PUT operation on http://a.com/users/100500 resource with ABUBAKA header. Preflight OPTIONS request will contain:
using this info you can decide what to do with such an request. For example, such resource could support both PUT and DELETE operations, and using ABUBAKA header is ok. In this case response should at least contain such headers
So, OPTIONS is some kind of policy method.
Upvotes: 1