开发者

JQuery Batchbook Rest API Consumption

Given t开发者_Python百科he following API call in Curl, how would I do this in JQuery?

curl -u #{api_key}:x -X GET https://#{your_account}.batchbook.com/service/people.xml


You don't want to do that with jQuery, because it'll expose your API key to your users.

If you really really really decided to use a jQuery AJAX call, though (maybe some sort of internal system where everyone with access would have access to the key), here's the code:

$.ajax({
  url: 'https://your-account.batchbook.com/service/people.xml',
  username: 'your api key',
  password: 'your password'
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜