//网络POSt请求
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
// 设置接受数据格式
[manager.responseSerializer setAcceptableContentTypes: [NSSet setWithObjects:@"application/json", @"text/json",@"text/javascript",@"text/html",@"text/CSS", nil]];
// 设置请求格式
manager.requestSerializer = [AFJSONRequestSerializer serializer];
// 设置返回格式
// manager.responseSerializer = [AFJSONResponseSerializer serializer];
//POST网络请求
[manager POST:apiName parameters:bodyDic success:^(AFHTTPRequestOperation *operation, id responSEObject) {
// success your code
}failure:^(AFHTTPRequestOperation *operation, NSError *error){
// failure your code
}
新闻热点
疑难解答