Inherits from NSObject
Conforms to NSURLConnectionDataDelegate
Declared in APITransaction.h

Overview

An abstract base class for performing asynchronous REST transactions to the cloud infrastructure over HTTP

Tasks

Properties

baseURL

@property NSString *baseURL
Discussion

The base URL of the remote server

Declared In

APITransaction.h

errorHandler

@property (copy) void ( ^ ) ( NSString *) errorHandler
Discussion

A block to call if an error occurs, passing a string describing the error

Declared In

APITransaction.h

errorMessage

@property NSString *errorMessage
Discussion

The most recent error message for this transaction

Declared In

APITransaction.h

jsonResult

@property id jsonResult
Discussion

The decoded json data returned from the transaction, if any

Declared In

APITransaction.h

receivedData

@property NSMutableData *receivedData
Discussion

The data returned from the transaction, if any

Declared In

APITransaction.h

success

@property BOOL success
Discussion

Indicates if the transaction was successful

Declared In

APITransaction.h

successHandler

@property (copy) void ( ^ ) ( ) successHandler
Discussion

A block to call upon success

Declared In

APITransaction.h

Class Methods

getSDKHeader

+ (NSString *)getSDKHeader
Discussion

Retrieve the SDK header sent with HTTP and WS requests. Includes the version of the SDK and the iOS version in the format “Respoke-iOS/<sdk_version> ( )”

Return Value

The SDK header

Declared In

APITransaction.h

Instance Methods

cancel

- (void)cancel
Discussion

Cancel any transaction in progress

Declared In

APITransaction.h

goWithSuccessHandler:errorHandler:

- (void)goWithSuccessHandler:(void ( ^ ) ( ))successHandler errorHandler:(void ( ^ ) ( NSString *))errorHandler
Discussion

Start the REST transaction

Parameters

successHandler

A block to call upon success

errorHandler

A block to call if an error occurs, passing a string describing the error

Declared In

APITransaction.h

initWithBaseUrl:

- (instancetype)initWithBaseUrl:(NSString *)newBaseURL
Discussion

Initialize the transaction class and specify the base URL of the Respoke service

Parameters

newBaseURL

The base URL of the Respoke service

Return Value

The newly initialized instance

Declared In

APITransaction.h

transactionComplete

- (void)transactionComplete
Discussion

A method called when the transaction has completed (overridden by child classes)

Declared In

APITransaction.h