ios AFNetworking 3.0 报错 : *** Assertion failure in -[AFHTTPRequestSerializer requestWithMethod:URLSt

这个问题是我做上传数据的时候碰到的解决方法如下:

NSString * uploadUrl = @"

http://cloud.ainuoedu.com/services/teacherservice.asmx/ArticleClass_Add?userid=6D65F83AFE851565&title=命,你命,j&summary=安安安安安啊,

";


只写了个url就会报上面的错误,加一句话如下:

NSString *str1 = [uploadUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];


OK 搞定!!!!!

   AFHTTPSessionManager * manager = [AFHTTPSessionManager manager];

            manager.responseSerializer = [AFHTTPResponseSerializer serializer];

           

            [manager GET:str1 parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {

                

            } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {

                

                NSLog(@"上传成功");

                

                

            } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {


                NSLog(@"上传失败");

                

            }];



你可能感兴趣的:(ios AFNetworking 3.0 报错 : *** Assertion failure in -[AFHTTPRequestSerializer requestWithMethod:URLSt)