Book Image

Application Development with Qt Creator - Second Edition

Book Image

Application Development with Qt Creator - Second Edition

Overview of this book

Table of Contents (20 chapters)
Application Development with Qt Creator Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Accessing HTTP resources using Qt


A common thing to do in today's networked world is use the HyperText Transfer Protocol (HTTP) to access a remote resource or service on the Web. To do this, your application should first use Qt's support to select a bearer network to make the HTTP request, and then, it should use its support for HTTP to make one or more HTTP requests across the network connection that the bearer network service opened.

To begin with, you need to be sure that you include the network module in your Qt declaration by editing your project file to include the following:

QT += network

Today's computing devices support multiple ways to access the network. For example, an Android tablet can have a built-in 4G wireless wide area network adapter as well as a Wi-Fi radio with multiple network configurations for different access points. The Android platform contains sophisticated code to bring up the appropriate network interface based on the wireless network that provides the best bandwidth...