CFx SDK Documentation
2022 SP0
|
#include <FxNANetworkRequest.h>
Public Member Functions | |
CFxNANetworkRequest (const CFxNAUrl &url=CFxNAUrl()) | |
CFxNANetworkRequest (const CFxNANetworkRequest &other) | |
CFxNANetworkRequest & | operator= (const CFxNANetworkRequest &other) |
~CFxNANetworkRequest () | |
void | setHandle (FxNetworkRequestHandle handle) |
FxNetworkRequestHandle | getHandle () const |
void | setHeader (CFxNANetworkRequest::KnownHeaders header, const CFxNAVariant &value) |
CFxNAVariant | header (CFxNANetworkRequest::KnownHeaders header) const |
void | setRawHeader (const CFxNAByteArray &headerName, const CFxNAByteArray &headerValue) |
CFxNAVariant | rawHeader (const CFxNAByteArray &headerName) const |
CFxNAList< CFxNAByteArray > | rawHeaderList () const |
void | setUrl (const CFxNAUrl &url) |
CFxNAUrl | url () const |
void | setRequestTimeout (int timeoutMs) |
int | requestTimeout () const |
Class CFxNANetworkRequest holds a request to be sent with CFxNANetworkAccessManager.
Definition at line 53 of file FxNANetworkRequest.h.
This enum type indicates Attribute codes for the CFxNANetworkRequest and CFxNANetworkReply.
Enumerator | |
---|---|
HttpStatusCodeAttribute | Replies only, type: CFxMetaType::Int (no default) Indicates the HTTP status code received from the HTTP server (like 200, 304, 404, 401, etc.). If the connection was not HTTP-based, this attribute will not be present. |
HttpReasonPhraseAttribute | Replies only, type: CFxMetaType::QByteArray (no default) Indicates the HTTP reason phrase as received from the HTTP server (like "Ok", "Found", "Not Found", "Access Denied", etc.) This is the human-readable representation of the status code (see above). If the connection was not HTTP-based, this attribute will not be present. |
RedirectionTargetAttribute | Replies only, type: CFxMetaType::CFxUrl (no default) If present, it indicates that the server is redirecting the request to a different URL. |
ConnectionEncryptedAttribute | Replies only, type: CFxMetaType::Bool (default: false) Indicates whether the data was obtained through an encrypted (secure) connection. |
CacheLoadControlAttribute | Requests only, type: CFxMetaType::Int (default: CFxNANetworkRequest::PreferNetwork) Controls how the cache should be accessed.. |
CacheSaveControlAttribute | Requests only, type: CFxMetaType::Bool (default: true) Controls if the data obtained should be saved to cache for future uses. |
SourceIsFromCacheAttribute | Replies only, type: CFxMetaType::Bool (default: false) Indicates whether the data was obtained from cache or not. |
DoNotBufferUploadDataAttribute | Requests only, type: CFxMetaType::Bool (default: false) Indicates whether the CFxNANetworkAccessManager code is allowed to buffer the upload data, e.g. when doing a HTTP POST. |
HttpPipeliningAllowedAttribute | Requests only, type: CFxMetaType::Bool (default: false) Indicates whether the CFxNANetworkAccessManager code is allowed to use HTTP pipelining with this request. |
HttpPipeliningWasUsedAttribute | Replies only, type: CFxMetaType::Bool Indicates whether the HTTP pipelining was used for receiving this reply. |
CustomVerbAttribute | Requests only, type: CFxMetaType::QByteArray Holds the value for the custom HTTP verb to send (destined for usage of other verbs than GET, POST, PUT and DELETE). This verb is set when calling. |
CookieLoadControlAttribute | Requests only, type: CFxMetaType::Int (default: CFxNANetworkRequest::Automatic) Indicates whether to send 'Cookie' headers in the request. This attribute is set to false by CommonUI WebKit when creating a cross-origin XMLHttpRequest where withCredentials has not been set explicitly to true by the Javascript that created the request. |
AuthenticationReuseAttribute | Requests only, type: CFxMetaType::Int (default: CFxNANetworkRequest::Automatic) Indicates whether to use cached authorization credentials in the request, if available. |
CookieSaveControlAttribute | Requests only, type: CFxMetaType::Int (default: CFxNANetworkRequest::Automatic) Indicates whether to save 'Cookie' headers received from the server in reply to the request. This attribute is set to false by CommonUI WebKit when creating a cross-origin XMLHttpRequest where withCredentials has not been set explicitly to true by the Javascript that created the request. |
MaximumDownloadBufferSizeAttribute | |
DownloadBufferAttribute | |
SynchronousRequestAttribute | |
BackgroundRequestAttribute | Type: CFxMetaType::Bool (default: false) Indicates that this is a background transfer, rather than a user initiated transfer. Depending on the platform, background transfers may be subject to different policies. |
SpdyAllowedAttribute | Requests only, type: CFxMetaType::Bool (default: false) Indicates whether the CFxNANetworkAccessManager code is allowed to use SPDY with this request. |
SpdyWasUsedAttribute | Replies only, type: CFxMetaType::Bool Indicates whether SPDY was used for receiving this reply. |
EmitAllUploadProgressSignalsAttribute | Requests only, type: CFxMetaType::Bool (default: false) Indicates whether all upload signals should be emitted. By default, the uploadProgress signal is emitted only in 100 millisecond intervals. |
FollowRedirectsAttribute | Requests only, type: CFxMetaType::Bool (default: false) Indicates whether the Network Access API should automatically follow a HTTP redirect response or not. |
HTTP2AllowedAttribute | Requests only, type: CFxMetaType::Bool (default: false) Indicates whether the CFxNANetworkAccessManager code is allowed to use HTTP/2 with this request. This applies to SSL requests or 'cleartext' HTTP/2. |
HTTP2WasUsedAttribute | Replies only, type: CFxMetaType::Bool (default: false) Indicates whether HTTP/2 was used for receiving this reply. |
OriginalContentLengthAttribute | Replies only, type CFxMetaType::Int Holds the original content-length attribute before being invalidated and removed from the header when the data is compressed and the request was marked to be decompressed automatically. |
RedirectPolicyAttribute | Requests only, type: CFxMetaType::Int, should be one of the CFxNANetworkRequest::RedirectPolicy values (default: ManualRedirectPolicy). |
User | Special type. Additional information can be passed in QVariants with types ranging from User to UserMax. The default implementation of Network Access will ignore any request attributes in this range and it will not produce any attributes in this range in replies. |
UserMax | Special type. See User. |
Definition at line 76 of file FxNANetworkRequest.h.
This enum type indicates known header types that CFxNANetworkRequest parses. Each known header is also represented in raw form with its full HTTP name.
Definition at line 60 of file FxNANetworkRequest.h.
Constructor
url | Input |
CFxNANetworkRequest::CFxNANetworkRequest | ( | const CFxNANetworkRequest & | other | ) |
Constructor
other | Input |
CFxNANetworkRequest::~CFxNANetworkRequest | ( | ) |
Destructor
FxNetworkRequestHandle CFxNANetworkRequest::getHandle | ( | ) | const |
CFxNAVariant CFxNANetworkRequest::header | ( | CFxNANetworkRequest::KnownHeaders | header | ) | const |
Returns the value of the known header header, if that header was sent by the remote server
header | Input attribute define by KnownHeaders enum |
CFxNANetworkRequest& CFxNANetworkRequest::operator= | ( | const CFxNANetworkRequest & | other | ) |
Constructor Operator overloaded
other | Input |
CFxNAVariant CFxNANetworkRequest::rawHeader | ( | const CFxNAByteArray & | headerName | ) | const |
Returns the raw contents of the header headerName as sent by the remote server.
headerName | Input |
CFxNAList< CFxNAByteArray > CFxNANetworkRequest::rawHeaderList | ( | ) | const |
Returns a list of headers fields that were sent by the remote server, in the order that they were sent.
Duplicate headers are merged together and take place of the latter duplicate.
int CFxNANetworkRequest::requestTimeout | ( | ) | const |
Returns the request timeout in milliseconds.
void CFxNANetworkRequest::setHandle | ( | FxNetworkRequestHandle | handle | ) |
void CFxNANetworkRequest::setHeader | ( | CFxNANetworkRequest::KnownHeaders | header, |
const CFxNAVariant & | value | ||
) |
Sets the value of the known header header to be value, overriding any previously set headers.
This operation also sets the equivalent raw HTTP header.
header | Input. |
value | Input. |
void CFxNANetworkRequest::setRawHeader | ( | const CFxNAByteArray & | headerName, |
const CFxNAByteArray & | headerValue | ||
) |
Sets the header headerName to be of value headerValue
If headerName corresponds to a known header (see CFxNANetworkRequest::KnownHeaders), the raw format will be parsed and the corresponding "cooked" header will be set as wel
headerName | Input. |
headerValue | Input. |
void CFxNANetworkRequest::setRequestTimeout | ( | int | timeoutMs | ) |
Set the request timeout in milliseconds. Request timeout of 0 means that default value of
30000 milliseconds should be used.
timeoutMs | Input. |
Sets the URL this network request is referring to be url.
url | Input. |
CFxNAUrl CFxNANetworkRequest::url | ( | ) | const |
Returns the URL this network request is referring to.