ActiveResourceKit  v1.2 (498.0)
 All Classes Files Functions Variables Typedefs Enumerator Properties Macros Pages
Functions
ARResource+Private.m File Reference
#import "ARResource+Private.h"
#import "ARService+Private.h"
#import "ARHTTPResponse.h"
#import "ARErrors.h"
Include dependency graph for ARResource+Private.m:

Go to the source code of this file.

Functions

NSNumber * ARIDFromResponse (ARHTTPResponse *response)
 Extracts the resource identifier from the given HTTP response.
 
BOOL ARResponseCodeAllowsBody (NSInteger code)
 Determines whether the HTTP 1.1 specification allows a response to have a body (see section 4.4.1 of the specification).
 

Function Documentation

NSNumber* ARIDFromResponse ( ARHTTPResponse response)

Extracts the resource identifier from the given HTTP response.

The HTTP response includes a Location header field specifying the resource's full resource location. Rails places the resource ID at the last element in the location path. The implementation extracts this element using a regular expression.

Returns
Answers an NSNumber numerical identifier based on the response location field. Answers nil if the response does not contain a Location header, or if the Location field does not match the format "/foo/bar/1".

Definition at line 30 of file ARResource+Private.m.

BOOL ARResponseCodeAllowsBody ( NSInteger  code)

Determines whether the HTTP 1.1 specification allows a response to have a body (see section 4.4.1 of the specification).

Definition at line 48 of file ARResource+Private.m.