ONGRequestBuilder Class Reference

Inherits from NSObject
Declared in ONGRequestBuilder.h

Overview

Object responsible for easier ONGResourceRequest construction.

+ builder

Return a new instance of a builder

+ (instancetype)builder

Declared In

ONGRequestBuilder.h

– setMethod:

Set the HTTP Method for the target ONGResourceRequest. The supported values are: GET, POST, PUT, DELETE.

- (instancetype)setMethod:(NSString *)method

Declared In

ONGRequestBuilder.h

– setPath:

Set the path for the target ONGResourceRequest.

- (instancetype)setPath:(NSString *)path

Discussion

Warning: the path must be relative to the resource base URL from the config model (ONGResourceBaseURL).

Declared In

ONGRequestBuilder.h

– setBody:

Set the body for the target ONGResourceRequest.

- (instancetype)setBody:(NSData *)body

Discussion

Setting the body on the request will overwrite the data passed as parameters and the parametersEncoding.

Declared In

ONGRequestBuilder.h

– setParameters:

Set the parameters for the target ONGResourceRequest.

- (instancetype)setParameters:(NSDictionary<NSString*,id> *)parameters

Discussion

For more information see the ONGResourceRequest.parameters

Declared In

ONGRequestBuilder.h

– setMultipartData:

Set the multipartData for the ONGResourceRequest.

- (instancetype)setMultipartData:(NSArray<ONGMultipartData*> *)multipartData

Declared In

ONGRequestBuilder.h

– setParametersEncoding:

Set the parametersEncoding for the target ONGResourceRequest.

- (instancetype)setParametersEncoding:(ONGParametersEncoding)parametersEncoding

Discussion

The default value is ONGParametersEncodingJSON.

Declared In

ONGRequestBuilder.h

– setHeaders:

Set the HTTP Headers for the target ONGResourceRequest.

- (instancetype)setHeaders:(NSDictionary<NSString*,NSString*> *)headers

Discussion

Warning: The following reserved headers take precedence over any custom values inserted by you: Authorization, User-Agent.

Declared In

ONGRequestBuilder.h

– build

The build instance of the ONGResourceRequest from the current parameters. Since the returned object is immutable any further parameter changes doesn’t have an effect on already build instances.

- (ONGResourceRequest *)build

Return Value

new a instance of the ONGResourceRequest

Declared In

ONGRequestBuilder.h