Objective-C 上传图片至服务端

NSURL *url = [NSURL URLWithString: urlString ];

    
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
NSMutableData *postData = [NSMutableData dataWithContentsOfFile:imagePath];  
  
[request setPostBodyFilePath:imagePath];

[request setRequestMethod:@"POST"];
[request startSynchronous];

你可能感兴趣的:(Objective-C)