• ios结构体httpPost头结构


    ios结构体httpPost头结构

    by 吴雪莹

    NSString* urlStr = @";
    NSURL* url = [NSURL URLWithString:urlStr];
    NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url];
    request.HTTPMethod = @"POST";
    [request addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
    NSString *postStr = @"";
    [request setHTTPBody:[postStr dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
    NSURLSession* session = [NSURLSession sessionWithConfiguration:config];
    
    NSURLSessionDataTask* dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
        if (error == nil) {
        }
    }];
    [dataTask resume];


    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    PyQt4 调用串口API pySerial API说明
    树的计算
    数据结构单链表实现
    虚函数和抽象函数
    静态内存和堆栈
    二叉树学习图片---郝斌
    汉诺塔
    循环队列的实现
    队列的实现
    栈的应用
  • 原文地址:https://www.cnblogs.com/zfyouxi/p/4658525.html
Copyright © 2020-2023  润新知