Bad URL when requesting with NSURL

后端 未结 4 1828
一生所求
一生所求 2020-12-01 19:44

I\'m trying to request this kind of URL in iPhone 4.0 SDK (access token slightly modified because you don\'t really need to see it):

https://graph.facebook.c         


        
4条回答
  •  失恋的感觉
    2020-12-01 20:03

     NSString *strURL = [loc_address stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
                // requesting weather for this location ... 
                NSMutableURLRequest *req = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat: @"http://www.google.com/ig/api?weather=%@", strURL]] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:5.0];
                [req setHTTPMethod:@"POST"];
                [req addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
    

提交回复
热议问题