Objective-C
Objective-C
HTTP Download from URL with IP Address and Port
See more HTTP Examples
Downloads a file from a URL using an IP address and port.Chilkat Objective-C Downloads
#import <CkoHttp.h>
#import <NSString.h>
BOOL success = NO;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkoHttp *http = [[CkoHttp alloc] init];
[http SetRequestHeader: @"Host" value: @"chilkatsoft.com"];
NSString *localFilePath = @"/temp/hamlet.zip";
success = [http Download: @"http://107.180.46.206:80/hamlet.zip" saveToPath: localFilePath];
if (success != YES) {
NSLog(@"%@",http.LastErrorText);
return;
}
NSLog(@"%@",@"OK!");