I have an API that generates json, problem is its password protected url, using Apache htpasswd.
how can I authenticate and retrieve the json from javascript, since all methods I have tried give me access deined (I've been using http://username:passwd@urldotcom/path/to/stuff)
Thanks
I figured out how to do it.
var something = jQuery.ajax({
type: "GET",
url: url,
username: "user",
password: "password"
});
url is a variable I declared earlier of format http:///path/to/json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With