AFNetworking 发送 raw 格式的 post 请求

    NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithDictionary:rawParams];

    NSData *data = [NSJSONSerialization dataWithJSONObject:params options:NSJSONWritingPrettyPrinted error:nil];

    [[[[AFNManager instance] rawManager] dataTaskWithRequest:request uploadProgress:^(NSProgress * _Nonnull uploadProgress) {
        
    } downloadProgress:^(NSProgress * _Nonnull downloadProgress) {
        
    } completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
        success(response, responseObject, error);
        [self alertError:responseObject];
    }] resume];

猜你喜欢

转载自blog.csdn.net/weixin_40287666/article/details/81129782
今日推荐