Inherits from NSObject
Declared in RKRequestDescriptor.h

Overview

An RKRequestDescriptor object describes an object mapping configuration that is used to construct the parameters of an HTTP request for an object. Request descriptors are defined by specifying the RKMapping object (whose objectClass must be NSMutableDictionary) that is to be used when object mapping an object into an NSDictionary of parameters, the class of the type of object for which the mapping is to be applied, and an optional root key path under which the paramters are to be nested. Response descriptors are only utilized when construct parameters for an NSURLRequest with an HTTP method of POST, PUT, or PATCH.

Tasks

Creating a Request Descriptor

Getting Information About a Request Descriptor

  •   mapping

    The mapping specifying how the object being parameterized is to be mapped into an NSDictionary representation. The mapping must have an objectClass equal to [NSMutableDictionary class].

    property
  •   objectClass

    The class of objects that the request descriptor is appropriate for use in parameterizing.

    property
  •   rootKeyPath

    The root key path that the paramters for the object are to be nested under. May be nil.

    property
  •   method

    The HTTP method(s) for which the mapping is to be used.

    property

Comparing Request Descriptors

Properties

mapping

@property (nonatomic, strong, readonly) RKMapping *mapping
Discussion

The mapping specifying how the object being parameterized is to be mapped into an NSDictionary representation. The mapping must have an objectClass equal to [NSMutableDictionary class].

Declared In

RKRequestDescriptor.h

method

@property (nonatomic, assign, readonly) RKRequestMethod method
Discussion

The HTTP method(s) for which the mapping is to be used.

Declared In

RKRequestDescriptor.h

objectClass

@property (nonatomic, strong, readonly) Class objectClass
Discussion

The class of objects that the request descriptor is appropriate for use in parameterizing.

Declared In

RKRequestDescriptor.h

rootKeyPath

@property (nonatomic, copy, readonly) NSString *rootKeyPath
Discussion

The root key path that the paramters for the object are to be nested under. May be nil.

Declared In

RKRequestDescriptor.h

Class Methods

requestDescriptorWithMapping:objectClass:rootKeyPath:

+ (instancetype)requestDescriptorWithMapping:(RKMapping *)mapping objectClass:(Class)objectClass rootKeyPath:(NSString *)rootKeyPath
Discussion

Creates and returns a new RKRequestDescriptor object.

This method is deprecated. Use + (instancetype)requestDescriptorWithMapping:(RKMapping *)mapping objectClass:(Class)objectClass rootKeyPath:(NSString *)rootKeyPath method:(RKRequestMethod)method instead.

Warning: An exception will be raised if the objectClass of the given mapping is not [NSMutableDictionary class].

Parameters

mapping

The mapping to be used when parameterizing an object using the request descriptor. Cannot be nil and must have an objectClass equal to [NSMutableDictionary class].

objectClass

The class of objects for which the request descriptor should be used. Cannot be nil.

rootKeyPath

The root key path under which paramters constructed using the response descriptor will be nested. If nil, the parameters will not be nested and returned as a flat dictionary object.

Return Value

A new RKRequestDescriptor object.

Declared In

RKRequestDescriptor.h

requestDescriptorWithMapping:objectClass:rootKeyPath:method:

+ (instancetype)requestDescriptorWithMapping:(RKMapping *)mapping objectClass:(Class)objectClass rootKeyPath:(NSString *)rootKeyPath method:(RKRequestMethod)method
Discussion

Creates and returns a new RKRequestDescriptor object.

Warning: An exception will be raised if the objectClass of the given mapping is not [NSMutableDictionary class].

Parameters

mapping

The mapping to be used when parameterizing an object using the request descriptor. Cannot be nil and must have an objectClass equal to [NSMutableDictionary class].

objectClass

The class of objects for which the request descriptor should be used. Cannot be nil.

rootKeyPath

The root key path under which paramters constructed using the response descriptor will be nested. If nil, the parameters will not be nested and returned as a flat dictionary object.

method

The HTTP method(s) for which the mapping is to be used.

Return Value

A new RKRequestDescriptor object.

Declared In

RKRequestDescriptor.h

Instance Methods

isEqualToRequestDescriptor:

- (BOOL)isEqualToRequestDescriptor:(RKRequestDescriptor *)otherDescriptor
Discussion

Returns YES if the receiver and the specified request descriptor are considered equivalent.

Declared In

RKRequestDescriptor.h