Permalink
Browse files

Reformatting method signatures in multipart form builder implementation

  • Loading branch information...
1 parent 6b9187b commit d7852c19e17d39a4954b5933d76eb3e22de0e41b @mattt mattt committed Jun 12, 2012
Showing with 15 additions and 4 deletions.
  1. +15 −4 AFNetworking/AFHTTPClient.m
@@ -768,7 +768,9 @@ - (void)appendBoundary {
}
}
-- (void)appendPartWithHeaders:(NSDictionary *)headers body:(NSData *)body {
+- (void)appendPartWithHeaders:(NSDictionary *)headers
+ body:(NSData *)body
+{
[self appendBoundary];
for (NSString *field in [headers allKeys]) {
@@ -779,22 +781,31 @@ - (void)appendPartWithHeaders:(NSDictionary *)headers body:(NSData *)body {
[self appendData:body];
}
-- (void)appendPartWithFormData:(NSData *)data name:(NSString *)name {
+- (void)appendPartWithFormData:(NSData *)data
+ name:(NSString *)name
+{
NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
[mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"", name] forKey:@"Content-Disposition"];
[self appendPartWithHeaders:mutableHeaders body:data];
}
-- (void)appendPartWithFileData:(NSData *)data name:(NSString *)name fileName:(NSString *)fileName mimeType:(NSString *)mimeType {
+- (void)appendPartWithFileData:(NSData *)data
+ name:(NSString *)name
+ fileName:(NSString *)fileName
+ mimeType:(NSString *)mimeType
+{
NSMutableDictionary *mutableHeaders = [NSMutableDictionary dictionary];
[mutableHeaders setValue:[NSString stringWithFormat:@"form-data; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"];
[mutableHeaders setValue:mimeType forKey:@"Content-Type"];
[self appendPartWithHeaders:mutableHeaders body:data];
}
-- (BOOL)appendPartWithFileURL:(NSURL *)fileURL name:(NSString *)name error:(NSError **)error {
+- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
+ name:(NSString *)name
+ error:(NSError **)error
+{
if (![fileURL isFileURL]) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
[userInfo setValue:fileURL forKey:NSURLErrorFailingURLErrorKey];

0 comments on commit d7852c1

Please sign in to comment.