我有一个应用程序,Afnetnetworking3.0
用于像这样的 Web 服务调用。
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager setRequestSerializer:[AFJSONRequestSerializer serializer]];
[manager setResponseSerializer:[AFJSONResponseSerializer serializer]];
NSURL * urlStr = [NSURL URLWithString:path];
NSDictionary *parameters = @{@"ID":@"fdfdfd",@"No":@"1414"};
NSLog(@"%@",parameters);
[manager POST:urlStr.absoluteString
parameters:parameters
progress:nil
success:^(NSURLSessionDataTask *task, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
NSLog(@"Error: %@", error);
}];
但它在参数字典中添加了一些空格并导致找不到 URL。谁能告诉我哪里出错了?