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¶m2=23¶m3=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.
精彩评论