Guest User

Untitled

a guest
Aug 24th, 2018
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. ASIHTTPRequest problem with parameters using 3G conneciton (Fine with Wifi)
  2. -(NSString *) encodeString:(NSString *) string
  3. {
  4. NSString * returnString = (NSString *)CFURLCreateStringByAddingPercentEscapes(
  5. NULL,
  6. (CFStringRef) string,
  7. NULL,
  8. (CFStringRef)@"!*'();:@&=+$,/?%#[]",
  9. kCFStringEncodingUTF8 );
  10. return [returnString autorelease];
  11. }
  12.  
  13. // Setup the url we need to make the request to the sharkscope API
  14. NSString * urlString = [NSString stringWithFormat: @"%SERVICEADDRESSHERE?Username=%@&Password=%@",
  15. encodedUserName, m_md5Key];
  16. NSURL * url = [NSURL URLWithString:urlString];
  17. request = [[ASIHTTPRequest requestWithURL:url] retain];
  18.  
  19. Username=Fred.Bloggs%40wanadoo.fr
  20.  
  21. Username=Fred.Bloogs%2540wanadoo.fr
Add Comment
Please, Sign In to add comment