【发布时间】:2011-07-28 08:24:36
【问题描述】:
我想显示一个网页。 为了显示该网页,我需要放置一个令牌(我已经拥有),该令牌将在“授权”字段的 HTTP 标头中给出。
目前,我尝试使用该代码:
NSString *authHeader = [@"Basic " stringByAppendingFormat:@"%@", token ];
NSURLRequest *requestObject = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://xxx.com/api_dev.php/1308149125"]];
然后,我将网页放入 webView 中(此代码正在运行):
[webView loadRequest:requestObject];//load the URL into the web view.
[self.view addSubview:webView];//add the web view to the content view.
谢谢你的帮助
【问题讨论】:
标签: iphone xcode http http-headers nsurlrequest