NSURLSession的GET和POST请求的封装(3)

 

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { NSLog(@"touchesBegan"); //创建参数字典 NSMutableDictionary *dict = @{@"username":@"zhangsan",@"password":@"zhang"}.mutableCopy; // 一句话发送 GET 请求. [[CZNetworkTool sharedNewtWorkTool] POSTRequestWithUrl:@"" paramaters:dict successBlock:^(id object, NSURLResponse *response) { NSLog(@"网络请求成功:%@",object); } FailBlock:^(NSError *error) { NSLog(@"网络请求失败"); }]; }

一句话发送POST请求

代码执行结果:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/3d5f9a5a6f934a6e1efa2f155bbbeecf.html