很少使用put方法,特此记录一下,参数Parameter Type为query时如何请求
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
// 设置请求头
[manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[manager.requestSerializer setValue:@"APP的token" forHTTPHeaderField:@"Authorization"];
//query请求参数
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
[dict setNonNilObject:@"小小" forKey:@"name"];
[managerPUT:httpPath parameters:dict ssuccess:^(NSURLSessionDataTask*_Nonnulltask,id _NullableresponseObject) {
if(success) {
success(responseObject);
}
}failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
if(fail) {
fail(error);
}
}];