Tag: getjson

使用AFNetworking 2.0访问DailyMile API

所以我从一个https站点(取回auth令牌后)发出JSON请求,并像堆栈溢出AFNetworking十几个其他问题,我得到这个错误: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn't be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x8dc2860 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.} 我用来提出这个请求的代码就像这样: AFHTTPRequestSerializer *requestSerializer = [AFHTTPRequestSerializer serializer]; [requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"]; //Set […]