0

I am making Ajax request with jQuery to Echonest, as you might know Echonest returns some headers to see the rate limit. I tried everything I know to read headers but I couldn't get any header.

This is my code:

$.ajaxSetup({traditional:true, cache: false});
                    url = 'http://developer.echonest.com/api/v4/song/profile?api_key=' + api_key + '&callback=?';
                    var req = $.getJSON(url,
                        {
                            id : songID,
                            format: 'jsonp',
                            bucket:['audio_summary']
                        }).done(function(data, status, resp){

                           console.log(resp.getAllResponseHeaders())
                           console.log(resp.getResponseHeader('X-Ratelimit-Limit'))
                        });

And this is the screenshot of the response:

enter image description here

I am trying to read X-Ratelimit-Limit

Thanks

1 Answer 1

1

I'm pretty sure there is no way to get headers from a jsonp request, but that service looks like json so do a json request instead.

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

1 Comment

Good to know, I didn't know that. I will check now.

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.