Inherits from NSMutableURLRequest
Declared in REAPIRequest.h

Tasks

Properties

timestamp

@property (nonatomic, readonly) NSTimeInterval timestamp

Class Methods

GET:withQuery:

+ (instancetype)GET:(NSString *)endpoint withQuery:(NSDictionary *)params
Discussion

Creates a GET HTTP request with the specified URL params.

Parameters

endpoint

The relative path

params

URL query parameters

Return Value

nil if the query can not be converted to a URL encoded query.

Declared In

REAPIRequest.h

POST:withBody:

+ (instancetype)POST:(NSString *)endpoint withBody:(NSData *)data
Discussion

Creates a POST HTTP request with the specified body.

Parameters

endpoint

The relative path

data

raw data included in the body

Declared In

REAPIRequest.h

POST:withJSON:

+ (instancetype)POST:(NSString *)endpoint withJSON:(NSDictionary *)params
Discussion

Creates a POST HTTP request and the query is serialized as a JSON in the HTTP’s body.

Parameters

endpoint

The relative path

params

JSON paramaters

Return Value

nil if the query can not be serialized to JSON.

Declared In

REAPIRequest.h

Instance Methods

initWithURL:method:data:timeout:

- (instancetype)initWithURL:(NSURL *)endpoint method:(NSString *)method data:(NSData *)data timeout:(NSUInteger)timeout