(Cocoa error 3840.)" (Invalid value around character 0.) AFNetworking

后端 未结 3 773
南方客
南方客 2020-12-29 04:14

I\'ve been getting the following error when using the GET method to retrieve a file from a server:

Error: Error Domain=NSCocoaErrorDomain Code=3840 \"The ope         


        
3条回答
  •  被撕碎了的回忆
    2020-12-29 04:35

    Judging by the discussion in the comments it appears that your GET request is successful (response code 200), but the response body is not valid JSON (nor a JSON fragment) as you have requested by your use of AFJSONResponseSerializer. A basic AFHTTPResponseSerializer can be used for responses that are not JSON.

提交回复
热议问题