QGIS API Documentation 4.1.0-Master (467af3bbe65)
Loading...
Searching...
No Matches
QgsNetworkRequestParameters Class Reference

Encapsulates parameters and properties of a network request. More...

#include <qgsnetworkaccessmanager.h>

Public Types

enum  RequestAttributes { AttributeInitiatorClass = QNetworkRequest::User + 3000 , AttributeInitiatorRequestId , AttributeOriginalHeaders , AttributeUserAgentSuffix }
 Custom request attributes. More...

Public Member Functions

 QgsNetworkRequestParameters ()=default
 QgsNetworkRequestParameters (QNetworkAccessManager::Operation operation, const QNetworkRequest &request, int requestId, const QByteArray &content=QByteArray())
 Constructor for QgsNetworkRequestParameters, with the specified network operation and original request.
QByteArray content () const
 Returns the request's content.
QString initiatorClassName () const
 Returns the class name of the object which initiated this request.
QVariant initiatorRequestId () const
 Returns the internal ID used by the object which initiated this request to identify individual requests.
QNetworkAccessManager::Operation operation () const
 Returns the request operation, e.g.
QString originatingThreadId () const
 Returns a string identifying the thread which the request originated from.
QNetworkRequest request () const
 Returns the network request.
int requestId () const
 Returns a unique ID identifying the request.

Detailed Description

Encapsulates parameters and properties of a network request.

Since
QGIS 3.6

Definition at line 54 of file qgsnetworkaccessmanager.h.

Member Enumeration Documentation

◆ RequestAttributes

Custom request attributes.

Enumerator
AttributeInitiatorClass 

Class name of original object which created the request.

AttributeInitiatorRequestId 

Internal ID used by originator object to identify requests.

AttributeOriginalHeaders 

Internal ID used to store original request headers, used when checking against previously cached responses.

Since
QGIS 4.0
AttributeUserAgentSuffix 

Custom string to append to the default User-Agent header.

Since
QGIS 4.2

Definition at line 58 of file qgsnetworkaccessmanager.h.

Constructor & Destructor Documentation

◆ QgsNetworkRequestParameters() [1/2]

QgsNetworkRequestParameters::QgsNetworkRequestParameters ( )
default

◆ QgsNetworkRequestParameters() [2/2]

QgsNetworkRequestParameters::QgsNetworkRequestParameters ( QNetworkAccessManager::Operation operation,
const QNetworkRequest & request,
int requestId,
const QByteArray & content = QByteArray() )

Constructor for QgsNetworkRequestParameters, with the specified network operation and original request.

Definition at line 985 of file qgsnetworkaccessmanager.cpp.

Member Function Documentation

◆ content()

QByteArray QgsNetworkRequestParameters::content ( ) const
inline

Returns the request's content.

This is only used for POST or PUT operation requests.

Definition at line 101 of file qgsnetworkaccessmanager.h.

◆ initiatorClassName()

QString QgsNetworkRequestParameters::initiatorClassName ( ) const
inline

Returns the class name of the object which initiated this request.

This is only available for QNetworkRequests which have had the QgsNetworkRequestParameters::AttributeInitiatorClass attribute set.

See also
initiatorRequestId()

Definition at line 111 of file qgsnetworkaccessmanager.h.

◆ initiatorRequestId()

QVariant QgsNetworkRequestParameters::initiatorRequestId ( ) const
inline

Returns the internal ID used by the object which initiated this request to identify individual requests.

This is only available for QNetworkRequests which have had the QgsNetworkRequestParameters::AttributeInitiatorRequestId attribute set.

See also
initiatorClassName()

Definition at line 122 of file qgsnetworkaccessmanager.h.

◆ operation()

QNetworkAccessManager::Operation QgsNetworkRequestParameters::operation ( ) const
inline

Returns the request operation, e.g.

GET or POST.

Definition at line 77 of file qgsnetworkaccessmanager.h.

◆ originatingThreadId()

QString QgsNetworkRequestParameters::originatingThreadId ( ) const
inline

Returns a string identifying the thread which the request originated from.

Definition at line 90 of file qgsnetworkaccessmanager.h.

◆ request()

QNetworkRequest QgsNetworkRequestParameters::request ( ) const
inline

Returns the network request.

This is the original network request sent to QgsNetworkAccessManager, but with QGIS specific configuration options such as proxy handling and SSL exceptions applied.

Definition at line 85 of file qgsnetworkaccessmanager.h.

◆ requestId()

int QgsNetworkRequestParameters::requestId ( ) const
inline

Returns a unique ID identifying the request.

Definition at line 95 of file qgsnetworkaccessmanager.h.


The documentation for this class was generated from the following files: