Hi. I’m having trouble using your API. I keep getting the 401 status. This is what I have to call it. Apologies in advance, I’m a newbie. Thanks.
var randomAPI = “https://andruxnet-random-famous-quotes.p.mashape.com/cat=movies”;
var randomOptions = {
“X-Mashape-Key”: “HBK2T7OffAmshmunnLnYngv0CcQup1JMuUVjsngYRpvpfLtulU”,
“Content-Type”: “application/x-www-form-urlencoded”,
“Accept”: “application/json”
};
function newWord(data) {
…
}
$.getJSON(randomAPI, randomOptions, newWord);
Присоединяйтесь к обсуждению – добавьте комментарий ниже:
I apologize for the looong wait of my reply. I’m glad you got it working.
This solution worked for me
$.ajax({
url: “https://andruxnet-random-famous-quotes.p.mashape.com/cat=movies”,
contentType: “application/x-www-form-urlencoded”,
method: “POST”,
headers: {‘X-Mashape-Key’: ‘mByTgz8NRXmshG13nKBuG4cUKuLqp1Q45WrjsnglfACnvbkLJE’},
accept: “application/json”,
})
.done(function (data){
alert("Data Saved: " + data );
})