开发者

How to post a hyperlink in objective-c?

开发者 https://www.devze.com 2022-12-12 10:49 出处:网络
How can I post a full hyperlink with its parameters to another link in objective-c? L开发者_JAVA百科ike: url=http://www.test.de/index.php?param1=23&param2=23&param3=345

How can I post a full hyperlink with its parameters to another link in objective-c?

L开发者_JAVA百科ike: url=http://www.test.de/index.php?param1=23&param2=23&param3=345

Thanks


Are you looking for a HTTP Post?

You will want to use a NSURLConnection with the POST method.

http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/Reference/Reference.html#//apple_ref/occ/instm/NSURLRequest/HTTPMethod


i've got it. I have to encoding the url link before sending the post value.

Here the function if someone need:

- (NSString *)urlEncodeValue:(NSString *)str
{
    NSString *result = (NSString *) CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)str, NULL, CFSTR("?=&+"), kCFStringEncodingUTF8);
    return [result autorelease];
} 

Thanks.

0

精彩评论

暂无评论...
验证码 换一张
取 消