AFN 网络请求,报错:Assertion failure in -[AFJSONRequestSerializer requestWithMethod:URLString:parameters:error:]
解决办法,把请求的url 做如下操作:
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
附加:
stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet] 这个方法是用来进行汉字转码的。
我请求的URL 里面有中文,才会报以上的错误。