Is there any way to have access to the response status and headers from a QueryTask or esriRequest?
Thanks.
Solved! Go to Solution.
Hi, I found the status code inside esriRequest only, not in a QueryTask.
The code can be checked here: request.ioArgs.xhr.status
var request = esriRequest(...);
request.then( function(response) { /* request.ioArgs.xhr.status */ } );
Just curious, are you needing to add custom headers? If so, check out Insert custom http header into request
Otherwise, are you just needing to inspect for debugging? If that's the case, I'd check out Fiddler - Fiddler free web debugging proxy
You'll want to make sure you set-up https decryption under options to capture secured traffic, but the Fiddler inspectors will give all of this information - headers and response result.
If you're not looking for either of these, could you provide just a bit more info on what you're hoping to do?
Hi, is neither of those. What I would like to know if the status code to check if it is 304, not modified.
Using Fiddler I checked that AGS does return this on the QueryTask but in Javascript I cannot see it.
I will use this to update graphics layers and combo boxes only when there is new data.
Hi, I found the status code inside esriRequest only, not in a QueryTask.
The code can be checked here: request.ioArgs.xhr.status
var request = esriRequest(...);
request.then( function(response) { /* request.ioArgs.xhr.status */ } );