Class for reading file and storing locally.
More...
#include <sessionrequest.h>
|
| SessionRequest (const Common::String &url, const Common::Path &localFile, DataCallback cb=nullptr, ErrorCallback ecb=nullptr, bool binary=false) |
|
void | start () |
|
void | startAndWait () |
|
void | reuse (const Common::String &url, const Common::Path &localFile, DataCallback cb=nullptr, ErrorCallback ecb=nullptr, bool binary=false) |
|
void | handle () override |
|
void | restart () override |
|
void | close () |
|
void | abortRequest () |
| Closes the current request and removes any unfinished files.
|
|
bool | complete () |
|
bool | success () |
|
char * | text () |
|
Common::JSONValue * | json () |
|
byte * | getData () |
|
uint32 | getSize () |
|
| CurlRequest (DataCallback cb, ErrorCallback ecb, const Common::String &url) |
|
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) |
|
| Request (DataCallback cb, ErrorCallback ecb) |
|
virtual void | handleRetry () |
|
virtual void | pause () |
|
virtual void | finish () |
|
virtual void | retry (uint32 seconds) |
|
RequestState | state () const |
|
Class for reading file and storing locally.
- Returns
- Returns SessionFileResponse in the callback
◆ getPreparedContents()
char* Networking::SessionRequest::getPreparedContents |
( |
| ) |
|
|
protected |
Prepares raw bytes from _contentsStream.
◆ finishError()
void Networking::SessionRequest::finishError |
( |
const ErrorResponse & |
error, |
|
|
RequestState |
state = PAUSED |
|
) |
| |
|
overrideprotectedvirtual |
Sets FINISHED state and calls the _errorCallback with given error.
Reimplemented from Networking::Request.
◆ finishSuccess()
void Networking::SessionRequest::finishSuccess |
( |
| ) |
|
|
overrideprotectedvirtual |
Sets FINISHED state. Implementations might extend it if needed.
Reimplemented from Networking::Request.
◆ handle()
void Networking::SessionRequest::handle |
( |
| ) |
|
|
overridevirtual |
◆ restart()
void Networking::SessionRequest::restart |
( |
| ) |
|
|
overridevirtual |
◆ close()
void Networking::SessionRequest::close |
( |
| ) |
|
This request DOES NOT delete automatically after calling callbacks. It gets PAUSED, and in order to make it FINISHED (i.e. delete), this method MUST be called.
The documentation for this class was generated from the following file: