NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndKeys:@"abcd",@"UID", nil];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://xyz:8080/cde"] ];
[request setHTTPMethod:@"POST"];
[request setValue:dict forHTTPHeaderField:@"parameter"];
[request setValue:@"get-employee-details" forHTTPHeaderField:@"serviceName"];
//[request setValue:@"pk703s" forHTTPHeaderField:@"ATTUID"];
AFHTTPRequestOperation *oper = [[AFHTTPRequestOperation alloc]initWithRequest: request] ;
[oper setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"Success");
NSLog(@"operation hasAcceptableStatusCode: %d", [operation.response statusCode]);
NSLog(@"response STring: %@ ", operation.responseString);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Failure");
NSLog(@"response: %@", operation.responseString);
NSLog(@"erro: %@", error.description);
}];
[oper start];
无法通过请求对象发送参数。如果我不发送参数,那么我无法调用服务