POST firing twice, no OPTIONS
See original GitHub issueSummary
Im using Axios and react for my front-end client and after long time of debugging i found out that something is triggering my Spring RestController method, always twice, always about two minutes in (it’s very long response with huge amount of data)
Network tab does not show this second POST, but when ran from Postman, everything works as expected (no random double calls)
` showCurrent = (dateA, dateB) => {
console.log("whaaaaat")
axios.post("api/allData", {
params: {
date_a: dateA,
date_b: dateB
}})
//successful fetch
.then(res => this.setState({
Data: res.data,
isLoading: false,
showPage: true,
home: false,
}))
.catch(function (error) {
//handle errors here
alert(error.message);
})
};`
This will print “whaaat” only once, despite below axios request happening twice.
Context
- axios version: v0.18.0
- Environment: Ubuntu / windows 8
- Browsers: Firefox
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
POST Request Firing Twice When Pressing Button After Page ...
When pressing the button which sends a POST request, the request is fired twice but only after the page is freshly reloaded.
Read more >Post Registration Hook is firing twice - Auth0 Community
For some reason, as of a couple of days ago, our post registration hook seems to be firing twice, sending duplicate user info...
Read more >BUG: Email Triggers firing twice - Forum - VisualCron
Since the last update, we have noticed that jobs triggered by emails are activating twice. The email trigger is set to move the...
Read more >publish_post hook trigger twice when I publish post
I am trying to send email post content on post publish and written small function in functions.php but it fires twice I am...
Read more >LWC Wire Service - Firing Twice - Salesforce Stack Exchange
The second time it fires is immediately after it receives data (or generates an error). In other words, response in your code will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My Bad. Found the issue. “Node.js has a default timeout on all incoming requests, and if you don’t change the timeout, then Node.js will kill the TCP connection if you don’t respond to the client in that amount of time.” - https://github.com/expressjs/express/issues/2512
Worked fine after fixing my request timeout in node.js
@jkonze - I don’t have the access to close the issue.