ASIHttpRequest上传文件

//上传文件
ASIFormDataRequest *request=[ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"SomeUploadServer"]];
[request setFile:@"/Users/snakeninny/Library/Application Support/iPhone Simulator/4.2/Library/Fuck.rtf"  forKey:@"rtf"];
[request setDelegate:self];
[request startAsynchronous];

//上传数据
ASIFormDataRequest *request=[ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"SomeUploadServer"]];
[request setPostValue:@"snakeninny" forKey:@"username"];
[request setDelegate:self];
[request startAsynchronous];

你可能感兴趣的:(ASIHttpRequest上传文件)