question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

post method automatically changed to options ?

See original GitHub issue
  Vue.http.interceptors.push(function () {
      return {

          request: function (request) {
              var tokenVal = sessionStorage.getItem("token");
              if(tokenVal) {
                request.beforeSend = function() {
                  request.headers['token'] = tokenVal
                }
              }
              return request;    
          },

          response: function (response) {
              return response;
          }

      };
  });

image

After the headers to add a token, post method previously used to automatically become options

image

Why?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
varHarriecommented, Jun 30, 2016

@NicolasParada That’s right. #228

0reactions
jbiddulphcommented, Jul 16, 2018

I am having an issue with not being able to save data into a database so I read about CORS and then installed it by following steps here: https://stackoverflow.com/questions/39429462/adding-access-control-allow-origin-header-response-in-laravel-5-3-passport

still not working?!

Read more comments on GitHub >

github_iconTop Results From Across the Web

POST Method got converted to OPTIONS automatically
Basically I am using a POST method but it automatically gets converted to OPTIONS method. I know browser does this but also read...
Read more >
Why is my browser sending an OPTIONS HTTP request ...
As you can see, the POST method is never sent and only a method called OPTIONS is sent to the endpoint.
Read more >
When i send a post method it will change automatically into ...
When I send a post request it will change automatically into options. Here I have attached code for login module. login.ts
Read more >
REST Post Method changed to GET automatically when...
When I Submit Request for POST method with empty or null parameters, then the request is submitted as GET method.
Read more >
Cross-Origin Resource Sharing (CORS) - MDN Web Docs
An example of a cross-origin request: the front-end JavaScript code served from ... Access-Control-Allow-Methods: POST, GET, OPTIONS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found