浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Qt4 Synchronous HTTP Request | Erata.NET

 


Qt4 Synchronous HTTP Request

 

Problem

Creating a wrapper over QHttp that can perform GET and POST requests in a synchronous way.

 

Solution

In Qt4 QHttp can perform HTTP requests, but the API only allows asynchronous requests. This means that you need to specify a set of slots to handle the signals that can be emitted while the request if performed. Now don’t get me wrong, this is event driven programming and most of the times is the right way to go especially when writing a Qt based application.  The cases when event driven operations prove difficult to use are rare and usually can be programmed using events.

posted on 2012-04-19 23:08  lexus  阅读(282)  评论(0编辑  收藏  举报