Not Seeing Ajax Requests In Firebug If Header Has Been Modified
Posted
by FluidFoundation
on Stack Overflow
See other posts from Stack Overflow
or by FluidFoundation
Published on 2010-03-24T16:40:09Z
Indexed on
2010/03/24
16:43 UTC
Read the original article
Hit count: 321
Hey braintrust,
I'm making an ajax call using jQuery's library to an api, which requires a username and password encoded to base64 be added to the header.
here's a basic example:
$.ajax({ type: "GET", contentType: 'application/json', beforeSend:function(xhr){ xhr.setRequestHeader("Authentication", "Basic " + base64EncodedValue); } url: 'https://api.company.com/uri/', complete: function(result) { alert(result); } });
But when this fires off, I get a black alert box, so it doesn't appear as if something is coming back. There is no log in the Firebug console that a get ajax request was done.
However, if I remove the beforeSend option, I do see the ajax request get logged, but the request gets back a 'not authorized', so it definitely hit the right place.
Any ideas on why it's not showing up in Firebug so I can verify the headers are being sent out correctly?
© Stack Overflow or respective owner