UIWebview post数据到网页上

NSString *postStr = [NSString stringWithFormat:@"token=%@",g_config.token];

NSData *data = [postStr dataUsingEncoding:NSUTF8StringEncoding];

NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: [NSURL URLWithString:_urlStr]];

[request setHTTPMethod: @"POST"];

[request setHTTPBody: data];

agencyWebView=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height)];

[agencyWebView loadRequest:request];

你可能感兴趣的:(UIWebview post数据到网页上)