Inherits from AFHTTPResponseSerializer : NSObject
Declared in AFURLResponseSerialization.h

Overview

AFJSONSerializer is a subclass of AFHTTPSerializer that validates and decodes JSON responses.

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

  • application/json
  • text/json

Tasks

  •   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
  • + 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

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