Created
February 19, 2016 12:08
-
-
Save catalinaturlea/c14565643fb814c0904e to your computer and use it in GitHub Desktop.
upload example from Objective-c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [AlamofireWrapper upload:RequestMethodPOST :@"http://myaddress.com" headers:nil multipartFormData:^NSArray<BodyPart *> * _Nonnull { | |
| return @[[[BodyPart alloc] initWithData:[NSData dataWithContentsOfFile:@"myVeryLargeFile.jpg"] name:@"picture"]]; | |
| } success:^(NSURLRequest * _Nullable request, NSHTTPURLResponse * _Nullable response, NSDictionary * _Nullable json) { | |
| NSLog(@"Success"); | |
| } failure:^(NSURLRequest * _Nullable request, NSHTTPURLResponse * _Nullable response, NSError * _Nullable error) { | |
| NSLog(@"Failure"); | |
| }]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment