AFNetWorking序列化响应错误

时间:2015-08-17 13:51:53

标签: ios iphone afnetworking afnetworking-2

我用代码发出请求:

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer = [AFJSONResponseSerializer serializerWithReadingOptions:NSJSONReadingAllowFragments];
    [manager GET:requestURLString
      parameters:nil
         success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"JSON: %@", responseObject);
             callCompletion(nil);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);
        callCompletion(error);
    }];

有错误:

  Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Invalid value around character 0.) UserInfo=0x7fa261cf2720 {NSDebugDescription=Invalid value around character 0.}

我的回答如下:

 callback_1437492189642({"project":"2330","session":1408257});

如何序列化?

0 个答案:

没有答案