如何开始使用别人的API做一个小的跨站点脚本AJAX? [英] How do I begin with making a small cross-site AJAX script using someone's API?

查看:183
本文介绍了如何开始使用别人的API做一个小的跨站点脚本AJAX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说,我想用这个API: http://hiveminder.com/help/reference /API.html

Let's say I want to use this API: http://hiveminder.com/help/reference/API.html

指令穿行通过它的使用。 curl命令行工具,这我不熟悉。我想通过一个简单的脚本访问此API在自己的网页。有哪些步骤,我需要做到这一点?

The instructions walk through its use via. the curl command line tool, which I'm unfamiliar with. I want to access this API through a simple script on my own page. What are the steps I need to do this?

记住它已经多年,因为我已经做过了这一点。

Keep in mind it's been years since I've done any of this.

推荐答案

由于跨站点的请求不能从客户机完成的,需要将它们从服务器发起。我个人不熟悉Hiveminder,但在其中实现从一个域到另一个请求的方式一般为:

Because cross-site requests can't be done from the client, they need to be initiated from the server. I'm personally not familiar with Hiveminder, but the way in which you achieve requests from one domain to another is generally:

  • 在客户端,抢用户的任何需要的信息,并将其发送到服务器
  • 从服务器端发起一个请求到下一​​个域(在你的情况,Hiveminder)
  • 当结果从说域,发送信息备份到客户端。返回

我不知道你用什么语言,但既然你提到卷曲,你可能有兴趣检查出什么PHP提供了的其卷曲手动

I don't know what language your using, but since you mentioned cURL you may be interested in checking out what PHP offers in its cURL manual.

这篇关于如何开始使用别人的API做一个小的跨站点脚本AJAX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆