IOS How to encode url

/* encode url when request to server */
+ (NSString *) urlEncode:(NSString *)string {
    NSString *urlEn = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,(CFStringRef)string, NULL,
                                                                         (CFStringRef)@"!*'();:@&=+$,/?%#[]",
                                                                         kCFStringEncodingUTF8 );
    return urlEn;

}

Comments

Popular posts from this blog

LINUX Move and copy files using SSH

PHP Predefined Variables

Java : Variables Declaring