MCEClient Class Reference

Inherits from NSObject
Declared in MCEClient.h
MCEClient.m

Overview

The MCEClient class is a baseclass that can be used to communicate with web servers. Subclasses can be either initialized as synchronous or asynchronous and have access to an http client that is configured for their use.

– patch:payload:completion:

The patch:payload:completion: method sends the PATCH HTTP method to the specified URL.

- (void)patch:(NSURL *)url payload:(NSDictionary *)payload completion:(MCECompletionCallback)callback

Parameters

url

The URL to send the message to

payload

The payload to be sent to the server

callback

A callback that receives the data sent back from the server, if the error pointer is not null then the request failed and may be retried if desired.

Discussion

The patch:payload:completion: method sends the PATCH HTTP method to the specified URL.

Declared In

MCEClient.h

– get:completion:

The get:completion: method sends the GET HTTP method to the specified URL.

- (void)get:(NSURL *)url completion:(MCECompletionCallback)callback

Parameters

url

The URL to send the message to

callback

A callback that receives the data sent back from the server, if the error pointer is not null then the request failed and may be retried if desired.

Discussion

The get:completion: method sends the GET HTTP method to the specified URL.

Declared In

MCEClient.h

– post:payload:completion:

The post:payload:completion: method sends the POST HTTP method to the specified URL.

- (void)post:(NSURL *)url payload:(NSDictionary *)payload completion:(MCECompletionCallback)callback

Parameters

url

The URL to send the message to

payload

The payload to be sent to the server

callback

A callback that receives the data sent back from the server, if the error pointer is not null then the request failed and may be retried if desired.

Discussion

The post:payload:completion: method sends the POST HTTP method to the specified URL.

Declared In

MCEClient.h

– put:payload:completion:

The put:payload:completion: method sends the PUT HTTP method to the specified URL.

- (void)put:(NSURL *)url payload:(NSDictionary *)payload completion:(MCECompletionCallback)callback

Parameters

url

The URL to send the message to

payload

The payload to be sent to the server

callback

A callback that receives the data sent back from the server, if the error pointer is not null then the request failed and may be retried if desired.

Discussion

The put:payload:completion: method sends the PUT HTTP method to the specified URL.

Declared In

MCEClient.h

– delete:payload:completion:

The delete:payload:completion: method sends the DELETE HTTP method to the specified URL.

- (void)delete:(NSURL *)url payload:(NSDictionary *)payload completion:(MCECompletionCallback)callback

Parameters

url

The URL to send the message to

payload

The payload to be sent to the server

callback

A callback that receives the data sent back from the server, if the error pointer is not null then the request failed and may be retried if desired.

Discussion

The delete:payload:completion: method sends the DELETE HTTP method to the specified URL.

Declared In

MCEClient.h

– buildUrlWithBaseUrl:parts:

The buildUrlWithBaseUrl:parts: method assembles URLs based on a base and a set of component parts.

- (NSURL *)buildUrlWithBaseUrl:(NSURL *)baseUrl parts:(NSArray *)parts

Parameters

baseUrl

A URL base, eg http://acoustic.co

parts

An array of parts to append to the URL eg @[ @“foo”, @“bar”, @“baz.html” ]

Return Value

A URL with the base and the appended parts eg http://acoustic.co/foo/bar/baz.html

Discussion

The buildUrlWithBaseUrl:parts: method assembles URLs based on a base and a set of component parts.

Declared In

MCEClient.h