需要一个示例,演示如何做异步HTTP请求 [英] Need an example showing how to do async HTTP requests

查看:133
本文介绍了需要一个示例,演示如何做异步HTTP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用即时通讯的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

这篇关于需要一个示例,演示如何做异步HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆