Commit Graph

5 Commits

Author SHA1 Message Date
Juha Vuolle 01a5299453 Add api-key hearer to colorpaletteclient example
Colorpaletteclient is able to interface two server backends: public
reqres.in service and QHttpServer example service. The public reqres.in
service has recently started requiring an api-key HTTP header (see
https://reqres.in/signup).

This commit adds an api-key header if the app uses the public
reqres.in service. The header is added to the QNetworkRequestFactory
and is consequently then used in all subsequent requests.

The code is furthermore  adjusted so that it won't accidentally
remove the api-key when toggling another proprietary header ("token").

Pick-to: 6.9 6.8
Fixes: QTBUG-136790
Change-Id: Id19d223722fd8f735d76855a293bc77f680ed344
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-05-19 11:05:18 +03:00
Juha Vuolle 19040296e4 Include qrestaccessmanager.h with QtNetwork prefix
Use include style that is consistent with rest of the
application. The include style was a leftover from the times the
application itself defined "restaccessmanager.h". Since Qt 6.7
the qrestaccessmanager.h is a proper QtNetwork class header.

Pick-to: 6.9 6.8
Change-Id: I25c1103ed9ccef1aa1da86475a1e20d9dba76a3b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2025-04-17 07:41:33 +03:00
Juha Vuolle 02885ea89d Fix type related space character usage in colorpaletteclient example
Change '* ' into ' *', and '& ' into ' &'

Pick-to: 6.7
Change-Id: I29223b069d92f67195405fa88795469a6cc767a0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-14 14:05:52 +02:00
Juha Vuolle 6a6212a652 Change colorpaletteclient demo to use REST helpers
Pick-to: 6.7
Fixes: QTBUG-114649
Change-Id: I26723e51951bf8285c0bcc30ff3bc6f4970c1e8b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-14 14:05:42 +02:00
Juha Vuolle 80f9a83d90 Colorpalette HTTP REST client example
Replace the addressbook client example with a colorpalette client.
The corresponding addressbook server has been superseded by a
colorpalette server.

The client can interface the local QHttpServer colorpaletteserver
example as well as the publicly accessible reqres.in. Please note
that the reqres.in is stateless service, and eg. adding/updating colors
will have no actual effect.

Task-number: QTBUG-106041
Pick-to: 6.5
Change-Id: I4ea06bbcd9b32900a661f19e0abe0629275aaef1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-02-14 11:57:19 +02:00