Reputation: 100486
We can the response code with:
res.status(v);
but later on for the same request, how can we check to see if it has been set? I am looking at the Express docs and not seeing how to do something like:
res.getStatus() // => 500
Upvotes: 3
Views: 3986
Reputation: 15709
According to Aikon Mogwai you can use res.statusCode
.
I tried it and it works!! (in express 4.16)
Upvotes: 4
Reputation: 100486
res.statusCode
is the answer and this is a core Node.js thing, it's not particular to Express.
Upvotes: 6