Code Monkey home page Code Monkey logo

Comments (4)

kuitos avatar kuitos commented on July 28, 2024

Mostly the OPTIONS request was send by browser rather than axios instance, when you make a CORS request. So we can't/shouldn't handle the OPTIONS request.

from axios-extensions.

flc avatar flc commented on July 28, 2024

Hi, thank you for the prompt response! I use django rest framework on the backend that returns useful metadata of resources to an OPTIONS request. For example to dynamically build forms on the client side. http://www.django-rest-framework.org/api-guide/metadata/ What do you think?

from axios-extensions.

kuitos avatar kuitos commented on July 28, 2024

9.2 OPTIONS
The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.
Responses to this method are not cacheable.

With the w3 spec definition, only GET and HEAD response could be cacheable, so we may should not cache the OPTIONS response imo. Check the spec: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

Thanks for your feedback!🙂

from axios-extensions.

flc avatar flc commented on July 28, 2024

i guess it's plan B then :) what the drf metadata docs suggest under section "Creating schema endpoints".
thx for your responses, i'm closing this.

from axios-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.