/**************************************************************************** ** ** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:FDL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Free Documentation License Usage ** Alternatively, this file may be used under the terms of the GNU Free ** Documentation License version 1.3 as published by the Free Software ** Foundation and appearing in the file included in the packaging of ** this file. Please review the following information to ensure ** the GNU Free Documentation License version 1.3 requirements ** will be met: https://www.gnu.org/licenses/fdl-1.3.html. ** $QT_END_LICENSE$ ** ****************************************************************************/ /*! \page qthttpserver-overview.html \title Qt HTTP Server Overview \brief Provides insight into the HTTP protocol and the QtHttpServer module. Qt HTTP Server supports building an HTTP server into an application. It provides an implementation of the server side of the HTTP protocol, and also provides security through Transport Layer Security. Because it is designed for embedding in applications to expose things in a trusted network, and doesn't have robustness/security as a goal, it is not suitable for being internet-facing. \section1 How does it work? Qt HTTP Server provides building blocks for embedding a lightweight HTTP server in an application. There are classes for the messages sent and received, and for the different parts of an HTTP server. \section1 How do you use it? An HTTP server can created by subclassing the QAbstractHttpServer class, and overriding the \c handleRequest() function. The QAbstractHttpServer class provides functions for listening to incoming ports or binding to an existing QTcpServer. Dispatching to lambdas based on incoming URLs can be simplified by using the QHttpServerRouter class. This can be simplified even further by using the QHttpServer class. The QHttpServer class is a subclass of QAbstractHttpServer, and defines an overloaded route function to bind lambdas to different incoming URLs, and an afterRequest function to process the response further. When security is needed and you have Qt compiled with support for TLS, you can bind QAbstractHttpServer and its subclasses to a QSslServer object, providing Transport Layer Security handling, turning it into an HTTPS server. \section2 Related Information \list \li \l{RFC 2616} \endlist */