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.

Why are my post requests sended twice?

See original GitHub issue

I send post request like: Vue.http.post(url, {}, {params:data}).then(callback) I make the second param in post method a empty object because I don’t want to send JSON data. In chrome’s devtool, I record the network data, and I notice that there are two requests sended when I called post method. One of them has a ‘Request Method’ attribute whose value is ‘OPTIONS’.

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
nblackburncommented, Aug 23, 2016

That’s called a preflight request that allows the server to specify what is required for that request to be fulfilled.

It’s CORS related and is not an issue.

4reactions
devbirBrstcommented, Sep 5, 2017

Is there any explanation for as to why the pre-flight request also registers as a normal request to the server and overall the process of sending a request to the server via Vue JS method registers as 2 requests on the server and a request sent via jQuery ajax or separately via Postman registers as 1 request?

Read more comments on GitHub >

github_iconTop Results From Across the Web

POST request strange behavior - request is sent tw...
The problem is that the 2nd request that Power Query is sending has identical headers as the 1st request, so the timestamp and...
Read more >
Can an HTTPS request be sent twice?
If you're replaying an entire connection, that won't work because of the way the handshake occurs. Each new connection has sets of random...
Read more >
AXIOS sending Request Twice - Laracasts
I send a POST request to a API server and the request sent 2 times. The initial request succeed because the records are...
Read more >
Apache sending POST request twice - php - Super User
To diagnose it, set a global variable orderSent to false on page load, then before sending the POST /da/ordrer first check if it...
Read more >
Post update send webhooks twice - WordPress.org
This happens due to Ajax. We added so far a filter that can limit the execution of the same action to one time...
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