NSURL *url = [NSURL URLWithString:@"http://www.weather.com.cn/data/sk/101010300.html"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
request.HTTPMethod = @"GET";
request.HTTPMethod = @"POST";
[request setValue:<#(nullable NSString *)#> forHTTPHeaderField:<#(nonnull NSString *)#>];
NSString *bodyString = @"cinema_id=1533";
request.HTTPBody = [bodyString dataUsingEncoding:NSUTF8StringEncoding];
request.timeoutInterval = 60;
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData * __nullable data, NSURLResponse * __nullable response, NSError * __nullable error){
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
NSLog(@"%ld",httpResponse.statusCode);
NSLog(@"%@", httpResponse.allHeaderFields);
if (data) {
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil][@"weatherinfo"];
}
}];
[dataTask resume];