需要一个示例,演示如何做异步HTTP请求示例、如何做、演示、HTTP

2023-09-06 00:28:18 作者:你就是我最想要的丫头

使用即时通讯的Web服务,所以我想用一个异步线程用于HTTP认证请求,另一个线程后做出,而我的主线程运行更多的服务请求。

Im using a web service, so I want to use an async thread for the HTTP authentication request and another thread later to make additional service requests while my main thread runs.

想看看如何做到这一点,如何表现出某种方式在主要的应用程序忙消息一个很好的例子。如何在主应用程序知道当线程完成了吗?而如果我的线程遇到例外情况,我该如何处理呢?

Would like to see a good example of how to do this and how to show busy messages somehow in main app. How does the main app know when the thread finished? And what if my thread encounters exceptions, how do I deal with that?

HTTP请求后发送,使用相同的Cookie设置了由第一身份验证请求,所以将稍后请求拿起饼干一样,只是工作的?

HTTP requests are sent later, use the same cookies setup up by the first auth request, so will the later requests pick up the same cookies and just work?

推荐答案

看着这里的http://stackoverflow.com/questions/2022170/how-to-execute-web-request-in-its-own-thread