Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
允许通过xml远程访问数据?_Xml_Database_Api - Fatal编程技术网

允许通过xml远程访问数据?

允许通过xml远程访问数据?,xml,database,api,Xml,Database,Api,如果我想允许某人访问数据,以便将其放在他们的站点上,我可以让他们指向我服务器上的一个脚本,该脚本通过url进行某些查询,该脚本查询我的数据库,然后以xml格式将数据发送回请求脚本的人吗?那将是一个非常基本的api设置,不是吗?没有太多的数据,也没有太多的电话,所以不用担心它会减慢我的网站。我只是想知道这是否是创建api的一种普通/基本方法?您所描述的基本上是一种方法 我建议试试API。归结起来就是:在服务器上为客户端提供特定的URL。它们调用该URL,您以某种格式(通常是XML或JSON)向它们

如果我想允许某人访问数据,以便将其放在他们的站点上,我可以让他们指向我服务器上的一个脚本,该脚本通过url进行某些查询,该脚本查询我的数据库,然后以xml格式将数据发送回请求脚本的人吗?那将是一个非常基本的api设置,不是吗?没有太多的数据,也没有太多的电话,所以不用担心它会减慢我的网站。我只是想知道这是否是创建api的一种普通/基本方法?

您所描述的基本上是一种方法

我建议试试API。归结起来就是:在服务器上为客户端提供特定的URL。它们调用该URL,您以某种格式(通常是XML或JSON)向它们发送信息,以便它们进行进一步处理

示例:尝试访问此网站:

您将收到以下回复:

{"responseData": {"results":[{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://stackoverflow.com/","url":"http://stackoverflow.com/","visibleUrl":"stackoverflow.com","cacheUrl":"http://www.google.com/search?q\u003dcache:U1GC2GYOToIJ:stackoverflow.com","title":"\u003cb\u003eStack Overflow\u003c/b\u003e","titleNoFormatting":"Stack Overflow","content":"A language-independent collaboratively edited question and answer site for   programmers."},{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://stackoverflow.com/users/login","url":"http://stackoverflow.com/users/login","visibleUrl":"stackoverflow.com","cacheUrl":"http://www.google.com/search?q\u003dcache:4nkh8ecRZGUJ:stackoverflow.com","title":"Log In - \u003cb\u003eStack Overflow\u003c/b\u003e","titleNoFormatting":"Log In - Stack Overflow","content":"\u003cb\u003estackoverflow\u003c/b\u003e.com ■ api/apps ■ careers ■ serverfault.com ■ superuser.com \u003cb\u003e...\u003c/b\u003e"},{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://blog.stackoverflow.com/","url":"http://blog.stackoverflow.com/","visibleUrl":"blog.stackoverflow.com","cacheUrl":"http://www.google.com/search?q\u003dcache:iqtvg9Ge1c0J:blog.stackoverflow.com","title":"Blog – Stack Exchange","titleNoFormatting":"Blog – Stack Exchange","content":"They seem to think that we only have 659000 visitors to \u003cb\u003estackoverflow\u003c/b\u003e.com \u003cb\u003e...\u003c/b\u003e"},{"GsearchResultClass":"GwebSearch","unescapedUrl":"http://en.wikipedia.org/wiki/Stack_overflow","url":"http://en.wikipedia.org/wiki/Stack_overflow","visibleUrl":"en.wikipedia.org","cacheUrl":"http://www.google.com/search?q\u003dcache:mWu8b0BQAmwJ:en.wikipedia.org","title":"\u003cb\u003eStack overflow\u003c/b\u003e - Wikipedia, the free encyclopedia","titleNoFormatting":"Stack overflow - Wikipedia, the free encyclopedia","content":"In software, a \u003cb\u003estack overflow\u003c/b\u003e occurs when too much memory is used on the call   stack. The call stack contains a limited amount of memory, often determined at   \u003cb\u003e...\u003c/b\u003e"}],"cursor":{"pages":[{"start":"0","label":1},{"start":"4","label":2},{"start":"8","label":3},{"start":"12","label":4},{"start":"16","label":5},{"start":"20","label":6},{"start":"24","label":7},{"start":"28","label":8}],"estimatedResultCount":"1410000","currentPageIndex":0,"moreResultsUrl":"http://www.google.com/search?oe\u003dutf8\u0026ie\u003dutf8\u0026source\u003duds\u0026start\u003d0\u0026hl\u003den\u0026q\u003dstackoverflow"}}, "responseDetails": null, "responseStatus": 200}
这是谷歌搜索“Stackoverflow”的结果