Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要使用一个奇怪的 API。我想对 API 进行 HTTP 调用,API 将返回成功,但我需要等待来自该 API 的请求,然后才能响应客户端。
实现这一目标的最佳方法是什么?
是否可以选择让您的 API 符合 REST 标准?一个示例流程:让客户端 POST 到一个 url 以创建新资源并 GET/HEAD 获取该资源的状态,这样您在执行任何阻塞操作时就不需要阻塞客户端。