FSXMLHttpRequest Class Reference
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:
- Specify the URL with the url property.
- Define the onCompletion and onFailure handlers.
- Call the start method.
Tasks
-
url
property -
onCompletion
property -
onFailure
property -
lastError
property -
– start
-
– cancel
-
– performXPathQuery:
-
– contentForNode:
-
– contentForNodeAttribute:attribute:
-
– dateFromNode:
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
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