Unable to read response headers
See original GitHub issueHi Danial. Is there a way to get access to the response headers on success of the upload? I’m using:
file.upload.success(function (data, status, headers, config) {
console.log(status);
console.log(headers);
console.log(headers['Location']);
});
Console returns:
204
function anonymous(name)
undefined
Network tab shows Response Headers correctly as in this screenshot: http://cl.ly/image/2f1A1O2X0s3N
Any help? Thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
How to troubleshoot the error "Failed to process response ...
In almost every event, this error is caused by a connection failure. The error is correct, the service did not receive any response...
Read more >Issue with getting response headers - Stack Overflow
I'm passing pagination information in response header and unable to get using following method in angular 8. I'm getting 0 all the time...
Read more >couldn't read response headers (HTTP::ConnectionError) #459
I get this error when using persistent connection with high keep_alive_timeout value. Test script: require "http" url ...
Read more >Unable to get/access CSRF Token in login api response ...
So you're setting the Authorizarion Header of the request like Authorization: Bearer <the-token-value-from-the-cookie> or Authorization: Token < ...
Read more >Response Header - an overview | ScienceDirect Topics
Access-Control-Expose-Headers—A list of headers that the browser may make visible to the client. For example, JavaScript would be able to read exposed headers...
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
I managed to get the headers from an S3 upload by exposing the headers in the CORS config in my bucket:
<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin></AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedHeader></AllowedHeader> <ExposeHeader>Location</ExposeHeader> <ExposeHeader>ETag</ExposeHeader> <ExposeHeader>Date</ExposeHeader> </CORSRule> </CORSConfiguration>
By doing so, this works:
file.upload.then(function (data) { console.log(data.headers()); console.log(data.headers(‘Location’)); }
@marianocarpentier Thanks!! Saved me so much time!