开发者

How to call a RESTful web service in the async way?

I am wondering how to call a RESTful web service asyn开发者_开发知识库chronously? Any suggestions?


Since REST is based on HTTP, which is a synchronous request/response protocol, your only alternative is to wrap it in an asynch call on the client side.


Two possible solutions, depending if you want push or pull.

1) The caller can add a callback URL in the request HTTP header. This URL will be called by the service when the process is finished.

2) The service can add a process URL in the answer HTTP header. the caller can thus get information about the advance of his request and get the result when it is done.


You could always use client side code to async the sync call for the RestFul Web Service Call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜