Commit Graph

35 Commits

Author SHA1 Message Date
Øystein Heskestad aa9d7a2b25 Improve the Http Server documentation
The documentation needs to be improved especially because the headers
are highly templated and it is very hard to understand anything just
from the API.

Task-number: QTBUG-129103
Pick-to: 6.9 6.9.0
Change-Id: I7cb22f7b3501ecb727a50da89230e071637af512
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2025-03-10 12:07:28 +01:00
Topi Reinio d124fe9786 Doc: Remove Technology Preview status
Qt HTTP Server is out of technology preview in Qt 6.8.0.

Task-number: QTBUG-129773
Pick-to: 6.8
Change-Id: I2dc7ea1d4c90800f3bace9497370632bea690085
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-10-09 09:27:17 +00:00
Matthias Rauter a329eb9a17 Update documentation to new API
Pick-to: 6.8
Task-Id: QTBUG-128113
Change-Id: I05c0ee722033f82e693a10f66f5877e3a7fb5706
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-09-03 18:21:20 +02:00
Alexei Cazacov 21bd1709da Docs: Organize topics in the Qt HttpServer project
This commit organizes the articles, so they:
- have a reasonable tree structure
- can be navigated through the topic tree in the Qt Creator help viewer

Task-number: QTBUG-127313
Change-Id: I029e05c1131f302dff4fdc6289e0a89cf569871f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-08-07 11:27:06 +03:00
Øystein Heskestad bd5ac90224 QAbstractHttpServer: Remove QSslConfiguration and listen() methods
To keep the API lean, remove the SSL confguration and listen()
methods.

Instead using listen() on a QAbstractHttpServer, a user should
create an instance of a QTcpServer or QSslServer, then call
listen() on it before calling bind() on a QAbstractHttpServer
with it as an argument.

Task-number: QTBUG-125859
Pick-to: 6.8
Change-Id: I366c0a01d8b7ee3802e0bdd63b9d84813338f478
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-07-31 16:52:41 +02:00
Øystein Heskestad 04bf17a9ff QHttpServerResponse: Fix constness of status in implementation
The status parameter used in QHttpServerResponse constructors
are not const in header file, but const in the implementation.
This compiles on all compilers in CI, but does not work when
generating documentation. Status is not supposed to be const
because it is passed by value. Fix the implementation as well.

Also set warning limit to zero to enforce zero warnings in CI.

Task-number: QTBUG-125859
Pick-to: 6.8
Change-Id: Ia34831bd6210ca027666840056693d89562f97a3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-07-03 10:01:59 +02:00
Mate Barany b85c42f2cc Rename the RESTful Color Palette Server example
...to improve visibility for search engines.

Pick-to: 6.6 6.5
Task-number: QTBUG-114713
Change-Id: Ib4a921b85bac208f4cdabd0e07ba69639ebc0988
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2023-10-25 14:25:40 +02:00
Mate Barany 1937ab7481 Reference the colorpalette client from the server documentation
Reference the colorpalette client documentation from the colorpalette
server documentation.

Pick-to: 6.6 6.5
Task-number: QTBUG-114713
Change-Id: I9fa782d23ffffeae0eaf68c470f51ec186119af7
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-10-10 16:04:26 +02:00
Kai Köhne e35ed829f8 Highlight Simple HTTP Server example
Make sure the example is shown as one of the first in the
Web Technologies section of Qt Creator's Welcome screen.

Task-number: QTBUG-117224
Pick-to: 6.5 6.6 6.6.0
Change-Id: I5411c9aab24b6e8c3780f37056ef1f2139d4a651
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2023-09-29 12:42:37 +02:00
Safiyyah Moosa a8d5d1ab62 Doc:Add \examplecategories in qthttpserver
Change-Id: I6ed2c1ef0a5a0ebfb8300e63f29c474d59963e95
Task-number: QTBUG-116070
Pick-to: 6.5 6.6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-08-17 15:48:01 +02:00
Topi Reinio 02d25adeab Doc: Remove warninglimit .qdocconf variable
The most common limit for the maximum number of allowed documentation
warnings is zero. As all Qt module docs include() a common configuration
from qtbase, it's better to control the base warninglimit from a central
location in qtbase/doc/global.

This allows for a temporary increase of the limit across all modules as
needed - for example, when updating the QDoc binary that the CI
provisions to a version that introduces new types of documentation
warnings.

Task-number: QTBUG-113326
Change-Id: Icd515ff052108d86d50f030e8a95dde64a919fe0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-06-27 11:13:27 +00:00
Ievgenii Meshcheriakov cf0fe88507 examples: Remove 'Example' from descriptions
As specified in the current Example Guideline document.

Task-number: QTBUG-110895
Pick-to: 6.5
Change-Id: Ibd39195030f5b5af328fdae5868fdedeeddf3759
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-13 12:01:23 +00:00
Ievgenii Meshcheriakov 4e409a3bd6 examples: Integrate 'afterrequest' example into 'simple' example
Task-number: QTBUG-110895
Pick-to: 6.5
Change-Id: Ia44cdb14f2a6e16ca2b5a135b8252384f5465bea
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-08 13:49:08 +01:00
Konrad Kujawa 30e860e89c Refactor AddressBook server to be compatible with the reqres.in
Remove AddressBook example, instead create ColorPalette example.
ColorPalette is based on reqres.in, and it contains static assets
like colors, users, sessions JSON and avatar images to preload
to server upon start.

Pick-to: 6.5
Fixes: QTBUG-106040
Change-Id: I5edec8d26f11809782d5d40d8e2c15143617eeb9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2023-01-30 20:37:14 +02:00
Ievgenii Meshcheriakov a1e37b9504 addressbookserver: Use X-API-Key as the authentication header
Non-standard headers must start with "X-". The header check was
also made case-insensitive to match behavior of the standard headers.

Added documentation snippet showing how to create entries using curl.

Fixed JSON syntax in the documentation.

Use \badcode blocks for non-C++ code examples.

Fixes: QTBUG-107927
Pick-to: 6.5
Change-Id: I48fc171fe32164541d777e4dae5747683aba37ad
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-06 15:18:29 +01:00
Ievgenii Meshcheriakov 75b0ca7cff Rename addressbook example directory to match the example name
Also actually build the example and rename the example in
the documentation.

Pick-to: 6.4
Change-Id: I9c403ceed1562728f8f280d3412f6fb2c3b2a0f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-11-08 11:56:54 +02:00
Ievgenii Meshcheriakov aac76b7a31 Revert "Documentation: Spell out the module state"
This reverts commit 0d3a4a6a28.

Reason for revert: \modulestate command is now supported by
qdoc version used by coin.

This is not a clean revert due to documentation changes done
after the commit to be reverted.

Change-Id: Ib4ad3e79a12d0f8eabc52d39b257844917166634
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-11-02 12:28:03 +02:00
Kai Köhne e6f5aa34b2 Doc: Restructure intro & overview
Mention use cases as described in QTBUG-60105. Elaborate more on
the security aspect, making it explicit that the use of SSL/HTTPS does
not magically make the server fit for general-purpose servers.

Pick-to: 6.4
Change-Id: I5aef64d00fdb45e1b91020d98754f0d65ddb1562
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2022-09-27 07:51:56 +00:00
Kai Köhne 3f3a5c5c62 Doc: Update overview documentation
Move separate overview page to landing page - this is
the place where people should get a quick overview of what
the module is for, so IMO it better fits here.

While at it, linkify all referenced methods and signals.
Add also details on how to link to the module to this page,
and add a link to the logging page to the reference section.

Pick-to: 6.4
Change-Id: I05ac9a4d519aa96d345703c92382de6795d130c2
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-09-27 09:51:53 +02:00
Kai Köhne 689f523135 Doc: Fix name of C++ server page
This makes sure C++ classes are properly linked in the Contents
list of Assistant and Qt Creator. Setting the landingpage
also makes sure examples are properly listed for the module.

Fixes: QTBUG-106378
Pick-to: 6.4
Change-Id: I4cf9a7191f276a01eaf986cbe1b78b461fcbd52f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-13 12:02:02 +00:00
Konrad Kujawa 051e080d80 Add missing functionalities to RESTful Address Book server
Added server side basic authorization.

Fixes: QTBUG-105196
Pick-to: 6.4
Change-Id: Ia73ec2779da6615ef23e253f0ccf28853c78875b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-30 09:52:30 +02:00
Ievgenii Meshcheriakov 4f956d3bc6 Doc: Set examplesinstallpath
This hopefully will get examples listed in the Creator.

Fixes: QTBUG-105723
Pick-to: 6.4
Change-Id: I116f6bfe272e5ec06b94d2995a739296705ed0a6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-08-18 11:55:31 +02:00
Konrad Kujawa 58ec2ecb87 Add missing image to the RESTful Address Book Example
Task-number: QTBUG-105198
Change-Id: I2a0674dbe51a40d800f60dfe141b5614b35618f0
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2022-08-16 13:28:29 +00:00
Ievgenii Meshcheriakov 0d3a4a6a28 Documentation: Spell out the module state
\modulestate command was introduced in qdoc after branching to
6.4 was done. It is still useful to have this note in the module
documentation, so spell it out explicitly.

This amends a8ef93c629.

Change-Id: I3df6949be7aa886ff873c051b06e744a38d2168a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b9da3d877d)
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-08-16 11:14:04 +00:00
Ievgenii Meshcheriakov af3cdabf03 Doc: Clarify that other callables can be used as route handlers
Task-number: QTBUG-100868
Pick-to: 6.4
Change-Id: I8573c7ccd4a8741673c643ab670259510fbe5afe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-15 09:07:57 +00:00
Konrad Kujawa 7f8e90627b REST server endpoint in QHttpServer for an Address book example
Add an address book implementation example using QHttpServer.

Task-number: QTBUG-105198
Pick-to: 6.4
Change-Id: I72d88a4814425cfc94601f4c7955ca8b395b8ede
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-08-15 08:26:17 +02:00
Konrad Kujawa 543350c5be Provide an example covering the HTTPS functionality
Extend QHttpServer simple example by adding SSL configuration
that serves HTTPS requests. Change Qt::HttpServer linking
to private.

Fixes: QTBUG-105073
Pick-to: 6.4
Change-Id: I2da8d8e4418eac171494ccf7716fe8369d81020e
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-09 13:07:59 +02:00
Kai Köhne 0c697c01c7 CMake: Cosmetic cleanup
Prefer Qt6::HttpServer vs Qt::HttpServer (we don't expose all
information in Qt::HttpServer). Also, use PRIVATE linking by default.

Pick-to: 6.4
Change-Id: I3f6cce21cf124067321aa5b8bb17d3fa44a21501
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
2022-08-08 15:30:15 +02:00
Kai Köhne b6ab282ee5 Make Technical Preview state explicit in documentation
Use new \modulestate command (introduced in qttools commit 214521bf8d)
to mark QtHttpServer as technical preview.

Change-Id: Ib078c05641d78b8a1aff339da7b581e4f752fdec
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
2022-07-22 09:34:59 +02:00
Kai Köhne 340e2286f7 CMake: Use find_package(Qt6 REQUIRED ...)
This will make sure find_package explicitly fails if
HttpServer component is missing.

Change-Id: Ibda6059b77411cf482a747a16c97c178ea4f8563
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
2022-06-29 14:24:28 +02:00
Kai Köhne 412079c6dd Doc: Do not advertise generic include directive
We shouldn't advertise the include module header anymore. Instead, each
class advertises its header.

Pick-to: 6.4
Change-Id: If7a90c41a9986980f81053f86da29090e5de466e
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2022-06-27 15:45:03 +02:00
Lucie Gérard 57b0db0896 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I657c36f679b9448ec68d411a492171bc39df1411
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2022-06-22 17:35:22 +02:00
Øystein Heskestad cbfc8e2ccb Document logging
Fixes: QTBUG-75164
Change-Id: I2cfe4e22a1d391c54c5926e85ca9a92f8d8cb13b
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
2022-06-14 19:58:20 +02:00
Øystein Heskestad 0584094861 Remove QtSslServer module and use QSslServer class from QtNetwork
Task-number: QTBUG-100823
Fixes: QTBUG-104097
Change-Id: Ia511e479ec2f32cc1b4c1897e333fe1a1d356383
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit cec9c0b4d0)
2022-06-14 05:02:41 +00:00
Øystein Heskestad 6c144d5023 Add to module documentation
Task-number: QTBUG-100481
Change-Id: I7f80feb2180c616586138f721fab1cf50ee44cbb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-23 01:19:09 +02:00