如何开始使用别人的API做一个小的跨站点脚本AJAX?做一个、脚本、站点、API

2023-09-11 01:36:01 作者:积攒一身酷

比方说,我想用这个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.