Public Member Functions | |
CurlRequest (DataCallback cb, ErrorCallback ecb, const Common::String &url) | |
void | handle () override |
void | restart () override |
Common::String | date () const override |
virtual void | setHeaders (const Common::Array< Common::String > &headers) |
virtual void | addHeader (const Common::String &header) |
virtual void | addPostField (const Common::String &field) |
virtual void | addFormField (const Common::String &name, const Common::String &value) |
virtual void | addFormFile (const Common::String &name, const Common::Path &filename) |
virtual void | setBuffer (byte *buffer, uint32 size) |
virtual void | usePut () |
virtual void | usePatch () |
virtual void | connectionKeepAlive (long idle=120, long interval=60) |
virtual void | connectionClose () |
virtual NetworkReadStreamResponse | execute () |
const NetworkReadStream * | getNetworkReadStream () const |
void | wait (int spinlockDelay=5) |
Public Member Functions inherited from Networking::Request | |
Request (DataCallback cb, ErrorCallback ecb) | |
virtual void | handleRetry () |
virtual void | pause () |
virtual void | finish () |
virtual void | retry (uint32 seconds) |
RequestState | state () const |
Protected Member Functions | |
NetworkReadStream * | makeStream () |
Protected Member Functions inherited from Networking::Request | |
virtual void | finishError (const ErrorResponse &error, RequestState state=FINISHED) |
virtual void | finishSuccess () |
Protected Attributes | |
Common::String | _url |
NetworkReadStream * | _stream |
curl_slist * | _headersList |
Common::String | _postFields |
Common::HashMap< Common::String, Common::String > | _formFields |
Common::HashMap< Common::String, Common::Path > | _formFiles |
byte * | _bytesBuffer |
uint32 | _bytesBufferSize |
bool | _uploading |
bool | _usingPatch |
bool | _keepAlive |
long | _keepAliveIdle |
long | _keepAliveInterval |
Protected Attributes inherited from Networking::Request | |
DataCallback | _callback |
ErrorCallback | _errorCallback |
RequestState | _state |
uint32 | _retryInSeconds |
|
overridevirtual |
Method, which does actual work. Depends on what this Request is doing.
Implements Networking::Request.
Reimplemented in Networking::SessionRequest.
|
overridevirtual |
Method, which is used to restart the Request.
Implements Networking::Request.
Reimplemented in Networking::SessionRequest.
|
overridevirtual |
Return date this Request received from server. It could be extracted from "Date" header, which is kept in NetworkReadStream.
Reimplemented from Networking::Request.
|
virtual |
Replaces all headers with the passed array of headers.
Reimplemented in Cloud::OneDrive::OneDriveTokenRefresher, Cloud::Box::BoxTokenRefresher, Cloud::Dropbox::DropboxTokenRefresher, and Cloud::GoogleDrive::GoogleDriveTokenRefresher.
|
virtual |
Adds a header into headers list.
Reimplemented in Cloud::OneDrive::OneDriveTokenRefresher, Cloud::Box::BoxTokenRefresher, Cloud::Dropbox::DropboxTokenRefresher, and Cloud::GoogleDrive::GoogleDriveTokenRefresher.
|
virtual |
Adds a post field (key=value pair).
|
virtual |
Adds a form/multipart field (name, value).
|
virtual |
Adds a form/multipart file (field name, file name).
|
virtual |
Sets bytes buffer.
|
virtual |
Remembers to use PUT method when it would create NetworkReadStream.
|
virtual |
Remembers to use PATCH method when it would create NetworkReadStream.
|
virtual |
Remembers to use Connection: keep-alive or close.
|
virtual |
Starts this Request with ConnMan.
const NetworkReadStream* Networking::CurlRequest::getNetworkReadStream | ( | ) | const |
Returns Request's NetworkReadStream.
void Networking::CurlRequest::wait | ( | int | spinlockDelay = 5 | ) |