NSString * pathStr = @ "http://www.baidu.com ";
AFHTTPClient * httpClient = [[AFHTTPClient alloc] initWithBaseURL: [NSURL URLWithString: @ ""]; // set the url to null
HttpClient. parameterEncoding = AFJSONParameterEncoding;
[HttpClient setDefaultHeader: @ "Accept" value: @ "text/json"];
NSMutableDictionary * params = [[NSMutableDictionary alloc] init]; // The json data to be passed is a dictionary.
[Params setObject: UserID forKey: @ "userId"];
[Params setObject: [self. contDic objectForKey: @ "weiboId"] forKey: @ "operateId"];
[Params setObject: @ "8d0ce196d0eafa27780cc3a7217de71d92474021dc0a4fc593d4f9b9eda320ca" forKey: @ "key"];
// HttpClient's postPath is the pathStr above, that is, the URL you want to access. Here, a data request is submitted to the server,
[HttpClient postPath: pathStr parameters: params success: ^ (AFHTTPRequestOperation * operation, id responseObject ){
NSLog (@ "data ===%@", params );
NSString * responseStr = [[NSString alloc] initWithData: responseObject encoding: NSUTF8StringEncoding];
NSLog (@ "Request Successful, response '% @'", responseStr );
[ResponseStr release];
} Failure: ^ (AFHTTPRequestOperation * operation, NSError * error ){
NSLog (@ "[HTTPClient Error]: % @", error );