How to get HTTP headers

This falls under the easy, but not obvious class of iPhone programming problems. Worthy of a quick post: The headers for an HTTP connection are included in the NSHTTPURLResponse class. If you have an NSHTTPURLResponse variable you can easily get the headers out as a NSDictionary by sending the allHeaderFields message. For synchronous requests — … Read more

How to handle app URLs in a UIWebView?

Here’s what I came up with. In webView:shouldStartLoadWithRequest:navigationType:, I ask the OS to handle any non-http and non-https requests that it can, like so: – (BOOL)webView:(UIWebView *)wv shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { // Determine if we want the system to handle it. NSURL *url = request.URL; if (![url.scheme isEqual:@”http”] && ![url.scheme isEqual:@”https”]) { if ([[UIApplication sharedApplication]canOpenURL:url]) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)