开发者

JQuery Batchbook Rest API Consumption

开发者 https://www.devze.com 2023-01-22 10:43 出处:网络
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.xmlYou don\'t want to do that wi

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

精彩评论

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