POST请求
来源:互联网 发布:ansys15.0软件 编辑:程序博客网 时间:2024/06/05 11:08
@interface ShopController ()<UIWebViewDelegate>
@property (nonatomic,retain)UIView *view;
@property (nonatomic,strong)UIWebView *webView;
@end
@implementation ShopController
//设置下面TabBar的图标和标题以及tag。
-(id)init
{
if (self=[superinit]) {
self.tabBarItem=[[UITabBarItemalloc]initWithTitle:@"商城"image:[UIImage imageNamed:@"money.png"]tag:2];
}
return self;
}
- (void)viewDidLoad
{
[superviewDidLoad];
self.view.backgroundColor=[UIColorwhiteColor];
//设置NavigationItem上面的标题。
self.navigationItem.title=@"网上商城";
self.webView=[[UIWebViewalloc]initWithFrame:CGRectMake(0,0, self.view.bounds.size.width,self.view.bounds.size.height)];
//设置设个界面的WebView的delegate就是这个界面本身。
self.webView.delegate=self;
NSURL *url = [NSURLURLWithString: @"http://192.168.1.171/opencart/index.php?route=account/login"];
NSString *body = [NSStringstringWithFormat:@"email=%@&password=%@",@"13715202924",@"Abcd1234"];
NSMutableURLRequest *request = [[NSMutableURLRequestalloc]initWithURL: url];
[request setHTTPMethod: @"POST"];
[request setHTTPBody: [bodydataUsingEncoding: NSUTF8StringEncoding]];
[self.webView loadRequest: request];
[self.view addSubview:self.webView];
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
return YES;
}
@end
- post请求
- POST请求
- POST请求
- POST请求
- post请求
- POST请求
- post请求
- POST请求
- post请求
- post 请求
- post请求
- post请求
- POST请求
- POST请求
- post请求
- post请求
- post请求
- post请求
- java web开发工程师 对面向对象思想 的不理解
- sqlserver 分页查询总结
- LeetCode203:Remove Linked List Elements
- Java Synchronized与wait notify 连用-2 简化版
- Baidu Map API 学习历程
- POST请求
- 通过代码实现RelativeLayout的布局
- JXL Excel模版下载[列合并](2)
- apache相关配置问题
- 【模板整合】SAM后缀自动机的构建
- Android Exception : JAVA_HOME is set to an invalid directory
- 使用fiddler的断点调试抓包修改请求和响应
- 期望和方差
- [LeetCode] Product of Array Except Self