GET请求InvalidParameternotsatisfying

Jan 8, 2017

发表于(2015-11-26 11:54:45)
GET请求是最常见的请求,对于链接可以不需要parameter,但是有时链接古怪,在请求过程中,请求方法对
NSParameterAssert(URLString);的URLString 进行判别,于是乎,控制台崩溃打印为“Invalid parameter not satisfying: URLString”。
(http://www.bubuko.com/infodetail-398645.html)
这个地址可以解释,做法很简单,不要把你的paramater拼进URLString,单独写出来,如:
[[AFHTTPRequestOperationManager manager] GET:urlString parameters:paraDic success:^(AFHTTPRequestOperation *operation, id responseObject) { successBlock(operation,responseObject); NSLog(@"-----responseObject:%@",responseObject); } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"-----error:%@",error); failBlock(operation,error); }];