1 year ago

#324181

test-img

Curious Learner

Does 202 status code indicate that the server cannot handle the increased traffic?

I have read from these sources:

  1. https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  2. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202

I am maintaining an API for internal use in our organization. Recently, I got to know one person was getting a 202 response instead of a 200. But when I personally examined it, I did not get a 202, also there is no possible bug in the code.

Or is it occurring only due to the execution of the logic is taking time?

This is happening for get requests, but I have not set the status code to 202 programmatically.

Any suggestion gratefully accepted. Thanks in advance.


Edit after first comment #

The API is built using express.js. This is what I am doing:

router.get('/path/url', middleware, controller)
//controller
exports.controller = async (req, res) => {
   //some code using await keyword
}

Is it possible that because I am using async functions as controllers, 202 status code is being sent.

node.js

express

https

http-status-codes

0 Answers

Your Answer

Accepted video resources