ONGMutableResourceRequest Class Reference
Inherits from | ONGResourceRequest : NSObject |
---|---|
Declared in | ONGResourceRequest.h |
path
The path to the resource.
@property (copy) NSString *path
Discussion
Warning: The path must be relative to the resource base URL from the config model (ONGResourceBaseURL
).
Declared In
ONGResourceRequest.h
method
The HTTP Method. Supported values are: GET
, POST
, PUT
, DELETE
.
In case of an invalid method the request won’t be executed and an error is returned.
@property (copy) NSString *method
Discussion
The default value is GET
.
Declared In
ONGResourceRequest.h
headers
The HTTP Headers to be added to the network request.
@property (copy, nullable) NSDictionary<NSString*NSString*> *headers
Discussion
Warning: The following reserved headers take precedence over any custom values inserted by you: Authorization
, User-Agent
.
Declared In
ONGResourceRequest.h
body
The HTTP body to be added to the network request.
@property (copy, nullable) NSData *body
Discussion
Setting the body on the request will overwrite the data passed as parameters and the parametersEncoding.
Declared In
ONGResourceRequest.h
parameters
The parameters that will be added to the request. In conjunction with the parametersEncoding
value it forms the body or URL of the request.
@property (copy, nullable) NSDictionary<NSString*id> *parameters
Discussion
For example the parameters {“key”: “value”} for parameterEncoding
equals to ONGParametersEncodingFormURL will form the following URL:
https://your.resource.server/path?key=value
When using the ONGParametersEncodingJSON
encoding, the parameters dictionary will be appended to the body.
Declared In
ONGResourceRequest.h
multipartData
The array of data to send using the multipart/form-data
content type.
@property (copy, nullable) NSArray<ONGMultipartData*> *multipartData
Discussion
The multipart/form-data
Content-Type header is added automatically.
When you add multipart data to a request the parametersEncoding
property will be neglected.
Declared In
ONGResourceRequest.h
parametersEncoding
The type of parameters encoding. It affects on how parameters
get appended to the request. Sets the Content-Type
header value:
ONGParametersEncodingFormURL - application/x-www-form-urlencoded
ONGParametersEncodingJSON - application/json
ONGParametersEncodingPropertyList - application/x-plist
@property ONGParametersEncoding parametersEncoding
Discussion
The default value is ONGParametersEncodingJSON.
Declared In
ONGResourceRequest.h