Inherits from NSObject
Declared in QBHTTPClient.h

Tasks

Properties

completionQueue

@property (nonatomic, nullable) dispatch_queue_t completionQueue
Discussion

The dispatch queue for completionBlock. If NULL (default), the main queue is used.

Declared In

QBHTTPClient.h

session

@property (readonly, nonatomic) NSURLSession *session

Class Methods

new

+ (instancetype)new

Instance Methods

DELETE:parameters:success:failure:

- (QBRequest *)DELETE:(NSString *)URLString parameters:(nullable id)parameters success:(nullable qb_task_data_block)success failure:(nullable qb_task_error_block)failure
Discussion

Creates and runs an QBRequest with a DELETE request.

Parameters

URLString

The URL string used to create the request URL.

parameters

The parameters to be encoded according to the client request serializer.

success

A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.

failure

A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.

Declared In

QBHTTPClient.h

GET:parameters:progress:success:failure:

- (QBRequest *)GET:(NSString *)URLString parameters:(nullable id)parameters progress:(nullable qb_task_progress_block)downloadProgress success:(nullable qb_task_data_block)success failure:(nullable qb_task_error_block)failure
Discussion

Creates and runs an QBRequest with a GET request.

Parameters

URLString

The URL string used to create the request URL.

parameters

The parameters to be encoded according to the client request serializer.

downloadProgress

A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue.

success

A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object.

failure

A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.

Declared In

QBHTTPClient.h

HEAD:parameters:success:failure:

- (QBRequest *)HEAD:(NSString *)URLString parameters:(nullable id)parameters success:(nullable qb_task_block)success failure:(nullable qb_task_error_block)failure
Discussion

Creates and runs an QBRequest with a HEAD request.

Parameters

URLString

The URL string used to create the request URL.

parameters

The parameters to be encoded according to the client request serializer.

success

A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task.

failure

A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.

Declared In

QBHTTPClient.h

PATCH:parameters:success:failure:

- (QBRequest *)PATCH:(NSString *)URLString parameters:(nullable id)parameters success:(nullable qb_task_data_block)success failure:(nullable qb_task_error_block)failure
Discussion

Creates and runs an QBRequest with a PATCH request.

Parameters

URLString

The URL string used to create the request URL.

parameters

The parameters to be encoded according to the client request serializer.

success

A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.

failure

A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.

Declared In

QBHTTPClient.h

POST:parameters:progress:success:failure:

- (QBRequest *)POST:(NSString *)URLString parameters:(nullable id)parameters progress:(nullable qb_task_progress_block)uploadProgress success:(nullable qb_task_data_block)success failure:(nullable qb_task_error_block)failure
Discussion

Creates and runs an QBRequest with a POST request.

Parameters

URLString

The URL string used to create the request URL.

parameters

The parameters to be encoded according to the client request serializer.

uploadProgress

A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.

success

A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.

failure

A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.

Declared In

QBHTTPClient.h

PUT:parameters:success:failure:

- (QBRequest *)PUT:(NSString *)URLString parameters:(nullable id)parameters success:(nullable qb_task_data_block)success failure:(nullable qb_task_error_block)failure
Discussion

Creates and runs an QBRequest with a PUT request.

Parameters

URLString

The URL string used to create the request URL.

parameters

The parameters to be encoded according to the client request serializer.

success

A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.

failure

A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.

Declared In

QBHTTPClient.h

init

- (instancetype)init

initWithBaseURL:

- (instancetype)initWithBaseURL:(nullable NSURL *)url
Discussion

Initializes an QBHTTPClient object with the specified base URL.

Parameters

url

The base URL for the HTTP client.

Return Value

The newly-initialized HTTP client

Declared In

QBHTTPClient.h

initWithBaseURL:sessionConfiguration:

- (instancetype)initWithBaseURL:(nullable NSURL *)url sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration
Discussion

Initializes an QBHTTPClient object with the specified base URL.

This is the designated initializer.

Parameters

url

The base URL for the HTTP client.

configuration

The configuration used to create the managed session.

Return Value

The newly-initialized HTTP client

Declared In

QBHTTPClient.h