Inherits from NSObject
Declared in FSXMLHttpRequest.h

Overview

FSXMLHttpRequest is a class for retrieving data in the XML format over a HTTP or HTTPS connection. It provides the necessary foundation for parsing the retrieved XML data. This class is not meant to be used directly but subclassed to a specific requests.

The usage pattern is the following:

  1. Specify the URL with the url property.
  2. Define the onCompletion and onFailure handlers.
  3. Call the start method.

Properties

lastError

If the request fails, contains the latest error status.

@property (readonly) FSXMLHttpRequestError lastError

Discussion

If the request fails, contains the latest error status.

Declared In

FSXMLHttpRequest.h

onCompletion

Called upon completion of the request.

@property (copy) void ( ^ ) ( ) onCompletion

Discussion

Called upon completion of the request.

Declared In

FSXMLHttpRequest.h

onFailure

Called upon a failure.

@property (copy) void ( ^ ) ( ) onFailure

Discussion

Called upon a failure.

Declared In

FSXMLHttpRequest.h

url

The URL of the request.

@property (nonatomic, copy) NSURL *url

Discussion

The URL of the request.

Declared In

FSXMLHttpRequest.h

Instance Methods

cancel

Cancels the request.

- (void)cancel

Discussion

Cancels the request.

Declared In

FSXMLHttpRequest.h

contentForNode:

Retrieves content for the given XML node.

- (NSString *)contentForNode:(xmlNodePtr)node

Parameters

node

The node for content retreval.

Discussion

Retrieves content for the given XML node.

Declared In

FSXMLHttpRequest.h

contentForNodeAttribute:attribute:

Retrieves content for the given XML node attribute.

- (NSString *)contentForNodeAttribute:(xmlNodePtr)node attribute:(const char *)attr

Parameters

node

The node for content retrieval.

attr

The attribute from which the content is retrieved.

Discussion

Retrieves content for the given XML node attribute.

Declared In

FSXMLHttpRequest.h

dateFromNode:

Retrieves date from the given XML node.

- (NSDate *)dateFromNode:(xmlNodePtr)node

Parameters

node

The node for retrieving the date.

Discussion

Retrieves date from the given XML node.

Declared In

FSXMLHttpRequest.h

performXPathQuery:

Performs an XPath query on the parsed XML data. Yields a parseXMLNode method call, which must be defined in the subclasses.

- (NSArray *)performXPathQuery:(NSString *)query

Parameters

query

The XPath query to be performed.

Discussion

Performs an XPath query on the parsed XML data. Yields a parseXMLNode method call, which must be defined in the subclasses.

Declared In

FSXMLHttpRequest.h

start

Starts the request.

- (void)start

Discussion

Starts the request.

Declared In

FSXMLHttpRequest.h