A one-shot HTTP request that reports its result to a delegate.
More...
#include <Downloader.h>
|
|
NSURLRequest * | request |
| | The request being run.
|
|
NSURLSession * | session |
| | The session the request runs on.
|
|
NSURLSessionTask * | sessionTask |
| | The task carrying the request.
|
|
NSMutableData * | data |
| | The response body accumulated so far.
|
|
int64_t | dl_size |
| | The total byte count the response declared.
|
|
__weak id< DownloaderDelegate > | delegate |
| | The object told how the request finished.
|
|
int | _tag |
| | The caller's tag, distinguishing concurrent requests sharing one delegate.
|
|
| int | tag |
| | An integer tag the caller may attach to the request.
|
A one-shot HTTP request that reports its result to a delegate.
◆ cancel
Abandons the request.
Clears the weak delegate, cancels the session task, and drops the accumulated data.
- Ghidra address:
- 0xa83a4
- Ghidra address:
- 0xa83a4
◆ connectionCancel
| - (void) connectionCancel |
|
|
|
Cancels the current session task and clears it.
- Ghidra address:
- 0xa88e0
◆ currentProgress
| - (float) currentProgress |
|
|
|
The fraction of the expected total that has arrived.
- Returns
- Progress in [0,1], or 0 when the expected length is unknown or already exceeded.
- Ghidra address:
- 0xa8728
- Ghidra address:
- 0xa8728
◆ currentSize
| - (unsigned long long) currentSize |
|
|
|
The total bytes downloaded so far.
- Returns
- The length of the accumulated data, or 0 when none.
- Ghidra address:
- 0xa8710
- Ghidra address:
- 0xa8710
◆ getData
The body the request returned.
- Returns
- The downloaded bytes, or nil before completion.
- Ghidra address:
- 0xa8794
- Ghidra address:
- 0xa8794
◆ getDataInJSON
| - (NSDictionary *) getDataInJSON |
|
|
|
The body the request returned, parsed as JSON.
Returns nil rather than raising when the body is missing or will not parse, which is what -[LogoViewController downloaderFinished:] tests before reading any key out of it.
- Returns
- The parsed body, or nil.
- Ghidra address:
- 0xa87a4
- Ghidra address:
- 0xa87a4
◆ initWithURL:delegate:
| - (instancetype) initWithURL: |
|
(NSURL *) | url |
| delegate: |
|
(nullable id< DownloaderDelegate >) | delegate |
Builds a plain GET.
- Parameters
-
| url | The endpoint. |
| delegate | The object to report completion to, or nil. Stored weakly. |
- Returns
- The initialised request.
- Ghidra address:
- 0xa7d4c
◆ initWithURL:postData:delegate:
| - (instancetype) initWithURL: |
|
(NSURL *) | url |
| postData: |
|
(NSData *) | postData |
| delegate: |
|
(nullable id< DownloaderDelegate >) | delegate |
Builds a POST with an arbitrary body.
- Parameters
-
| url | The endpoint. |
| postData | The request body. |
| delegate | The object to report completion to, or nil. Stored weakly. |
- Returns
- The initialised request.
- Ghidra address:
- 0xa80a8
◆ initWithURL:postJsonData:delegate:
| - (instancetype) initWithURL: |
|
(NSURL *) | url |
| postJsonData: |
|
(NSData *) | jsonData |
| delegate: |
|
(nullable id< DownloaderDelegate >) | delegate |
Builds a JSON POST.
- Parameters
-
| url | The endpoint. |
| jsonData | The serialised request body. |
| delegate | The object to report completion to, or nil. Stored weakly. |
- Returns
- The initialised request.
- Ghidra address:
- 0xa7e9c
◆ startDownloading
| - (void) startDownloading |
|
|
|
Starts the request.
Cancels any previous session task first, then creates a new NSURLSession on the main queue and resumes its data task.
- Ghidra address:
- 0xa8298
- Ghidra address:
- 0xa8298
◆ tag
An integer tag the caller may attach to the request.
- Ghidra address:
- 0xa891c
The documentation for this class was generated from the following files: