rtwati on Wed, 06 Jul 2016 02:20:10
I am looking in this forum that how to read the Operation-Location header from response but none of the answers could get me the result. Could you please help me to read the Operation-Location so I can check the status of video and get the results of emotions of video. Without this location I am not able to query the api. Below are my code.
When I check in log below is output.
Cache-Control: no-cache Pragma: no-cache Expires: -1
And even the the request is accepted it call the function fail instead of done. Am i doing anything wrong in this code. Please help me I am stuck in this.
cthrash99 on Thu, 07 Jul 2016 03:32:09
Hi rtwati, there are two things happening here.
First, it is a jQuery idiosyncracy that an HTTP 202 response triggers the fail() method, presumably because your status is "Accepted", which is not the same as 'done'. So you'll want to check for a response.status in the fail() handler and see if the value is 202.
Second (which makes the first point moot) is that while the Operation-Location header is in the HTTP response, because this is a CORS request, headers that aren't convered by the (additional) Access-Control-Expose-Headers will not be included in the response.getAllResponseHeaders()