Inherits from AFHTTPResponseSerializer : NSObject
Declared in AFURLResponseSerialization.h

Overview

AFJSONResponseSerializer is a subclass of AFHTTPResponseSerializer that validates and decodes JSON responses.

By default, AFJSONResponseSerializer accepts the following MIME types, which includes the official standard, application/json, as well as other commonly-used types:

  • application/json
  • text/json
  • text/javascript

Tasks

  • – init
  •   readingOptions

    Options for reading the response JSON data and creating the Foundation objects. For possible values, see the NSJSONSerialization documentation section “NSJSONReadingOptions”. 0 by default.

    property
  •   removesKeysWithNullValues

    Whether to remove keys with NSNull values from response JSON. Defaults to NO.

    property
  • + serializerWithReadingOptions:

    Creates and returns a JSON serializer with specified reading and writing options.

Properties

readingOptions

@property (nonatomic, assign) NSJSONReadingOptions readingOptions
Discussion

Options for reading the response JSON data and creating the Foundation objects. For possible values, see the NSJSONSerialization documentation section “NSJSONReadingOptions”. 0 by default.

Declared In

AFURLResponseSerialization.h

removesKeysWithNullValues

@property (nonatomic, assign) BOOL removesKeysWithNullValues
Discussion

Whether to remove keys with NSNull values from response JSON. Defaults to NO.

Declared In

AFURLResponseSerialization.h

Class Methods

serializerWithReadingOptions:

+ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions
Discussion

Creates and returns a JSON serializer with specified reading and writing options.

Parameters

readingOptions

The specified JSON reading options.

Declared In

AFURLResponseSerialization.h

Instance Methods

init

- (instancetype)init