how to get raw JSON response from AFnetworking 2.0 operation / NSURLSessioNDataTask?

NoCarrier

This is my code.. its a very simple operation

[self GET:operationName parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
          NSLog(@"%@", responseObject);
          //do something upon success
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
         //do something to handle error
    }];

My question is, I need to see what the exact raw json response is.. when I NSLog the responseObject, it's not the same JSON output that I would get from a standalone HTTP client _ I guess its because it's been through the serializer?

Rob

If you don't want it to do the NSJSONSerialization conversion to NSArray/NSDictionary, but rather want the raw NSData, you should set the responseSerializer of the AFURLSessionManager to a AFHTTPResponseSerializer.

self.responseSerializer = [AFHTTPResponseSerializer serializer];

The default value is AFJSONResponseSerializer. If you don't want it to convert the JSON for you, change the response serializer.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

AFNetworking 2 GET with JSON response

From Dev

AFNetworking: Get JSON Value From Http Response

From Dev

How to get raw JSON text from Unirest response in Java

From Dev

How to get NSDictionary from NSURLSessionDataTask

From Dev

How to get status code from NSURLSessionDataTask?

From Dev

How to get data to return from NSURLSessionDataTask

From Dev

How to get data to return from NSURLSessionDataTask in Swift

From Dev

How to read RAW JSON in Angular JS from HTTP get method, when response type is arraybuffer?

From Dev

How to read RAW JSON in Angular JS from HTTP get method, when response type is arraybuffer?

From Dev

Retrofit2+Kotlin how to see a raw json while get response as data class

From Dev

Get the result of AFNetworking response as JSON string array

From Dev

Get plain response from AFNetworking 2.4.1

From Dev

How to get a json file from raw folder?

From Dev

Retrofit 2 how to get the response from nested json objects (android)

From Dev

iOS Get JSON response from AFNetworking HTTP POST method with JSON parameters

From Dev

AFNetworking: how to get the response string when failed?

From Dev

AFNetworking: how to get the response string when failed?

From Dev

Filtering operation on a response I get from retrofit 2 with rxJava

From Java

Retrofit 2: Get JSON from Response body

From Dev

Wcf get raw request from operation

From Dev

AFNetworking alters JSON response?

From Dev

How to get JSON ARRAY and JSON object response from retrofit response?

From Dev

getting XML from NSData response of an NSURLSessionDataTask request

From Dev

get a "raw" request\response from MITM Proxy

From Dev

get a "raw" request\response from MITM Proxy

From Dev

How to get value from the JSON response

From Dev

How to get a json response from yaler

From Dev

Retrofit - How to get response from JSON objects

From Dev

How to get the JSON of a response from a service

Related Related

  1. 1

    AFNetworking 2 GET with JSON response

  2. 2

    AFNetworking: Get JSON Value From Http Response

  3. 3

    How to get raw JSON text from Unirest response in Java

  4. 4

    How to get NSDictionary from NSURLSessionDataTask

  5. 5

    How to get status code from NSURLSessionDataTask?

  6. 6

    How to get data to return from NSURLSessionDataTask

  7. 7

    How to get data to return from NSURLSessionDataTask in Swift

  8. 8

    How to read RAW JSON in Angular JS from HTTP get method, when response type is arraybuffer?

  9. 9

    How to read RAW JSON in Angular JS from HTTP get method, when response type is arraybuffer?

  10. 10

    Retrofit2+Kotlin how to see a raw json while get response as data class

  11. 11

    Get the result of AFNetworking response as JSON string array

  12. 12

    Get plain response from AFNetworking 2.4.1

  13. 13

    How to get a json file from raw folder?

  14. 14

    Retrofit 2 how to get the response from nested json objects (android)

  15. 15

    iOS Get JSON response from AFNetworking HTTP POST method with JSON parameters

  16. 16

    AFNetworking: how to get the response string when failed?

  17. 17

    AFNetworking: how to get the response string when failed?

  18. 18

    Filtering operation on a response I get from retrofit 2 with rxJava

  19. 19

    Retrofit 2: Get JSON from Response body

  20. 20

    Wcf get raw request from operation

  21. 21

    AFNetworking alters JSON response?

  22. 22

    How to get JSON ARRAY and JSON object response from retrofit response?

  23. 23

    getting XML from NSData response of an NSURLSessionDataTask request

  24. 24

    get a "raw" request\response from MITM Proxy

  25. 25

    get a "raw" request\response from MITM Proxy

  26. 26

    How to get value from the JSON response

  27. 27

    How to get a json response from yaler

  28. 28

    Retrofit - How to get response from JSON objects

  29. 29

    How to get the JSON of a response from a service

HotTag

Archive