如何一次处理多个 api 请求

How to process multiple api requests in one

例如我有 some_website/a.json 其中包含:

{"test":"1","test2":"2"}

和 some_website/b.json 其中包含:

{"test":"3","test2":"4"}

我如何使用像

这样的 XMLHttpRequest 在 some_website/c.json 中获取和放置这些值
{"testing1":{"test":"1","test2":"2"},"testing2":{"test":"3","test2":"4"}}

这是天生不可能的。有像“批量请求”这样的技术。例如,Facebook 在他们的 API 中实现了它们。 Facebook Batch Request