iOS 使用AFN上傳數(shù)據(jù)問題
報這樣的錯 Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.
原因: 最常見的是接口添加了打印信息,或者接口抱錯,導(dǎo)致請求所返回來的數(shù)據(jù)非標(biāo)準(zhǔn)json格式而報錯
服務(wù)器返回數(shù)據(jù)不是json格式的,讓后端調(diào)一下就成。