2

I have this $resource call :

var account = Accounts.get(function() {

 //success - do something fancy

    }, function(data, status, headers){

        //error - grab x_something header

    });

In the failure callback when an HTTP 403 error returning with custom "x_something" header (I can see it in the network traffic in Chrome network tab) - I can't find it in data.headers() , or in any other place

Anyone know what I'm missing?

1 Answer 1

2

Try:

var account = Accounts.get(function() {

 //success - do something fancy

    }, function(httpResponse){

        //error - grab x_something header
        var x_something = httpResponse.headers("x_something");
    });

DEMO

In this demo, I log the Content-Type header, it would be similar to any custom header.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.