Open gonghongxia opened 8 years ago
MKNetworkKit Tag 0.87 change "MKNetworkOperation.m" file. Now status: -(NSData) bodyData { .......... [self.dataToBePosted enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL stop) { NSString *thisFieldString = [NSString stringWithFormat: @"--%@\r\nContent-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\nContent-Type: %@\r\nContent-Transfer-Encoding: binary\r\n\r\n", boundary, thisDataObject[@"name"], thisDataObject[@"filename"], thisDataObject[@"mimetype"]];
[body appendData:[thisFieldString dataUsingEncoding:[self stringEncoding]]]; [body appendData:thisDataObject[@"data"]]; [body appendData:[@"\r\n" dataUsingEncoding:[self stringEncoding]]]; }
}]; .......... }
Right status: -(NSData) bodyData { .......... NSDictionary *thisDataObject = (NSDictionary) obj; if([self.request.HTTPMethod isEqualToString:@"PUT"]){ [body appendData:thisDataObject[@"data"]]; }else{ NSString *thisFieldString = [NSString stringWithFormat: @"--%@\r\nContent-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\nContent-Type: %@\r\nContent-Transfer-Encoding: binary\r\n\r\n", boundary, thisDataObject[@"name"], thisDataObject[@"filename"], thisDataObject[@"mimetype"]];
.......... }
MKNetworkKit Tag 0.87 change "MKNetworkOperation.m" file. Now status: -(NSData) bodyData { .......... [self.dataToBePosted enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL stop) { NSString *thisFieldString = [NSString stringWithFormat: @"--%@\r\nContent-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\nContent-Type: %@\r\nContent-Transfer-Encoding: binary\r\n\r\n", boundary, thisDataObject[@"name"], thisDataObject[@"filename"], thisDataObject[@"mimetype"]];
}]; .......... }
Right status: -(NSData) bodyData { .......... NSDictionary *thisDataObject = (NSDictionary) obj; if([self.request.HTTPMethod isEqualToString:@"PUT"]){ [body appendData:thisDataObject[@"data"]]; }else{ NSString *thisFieldString = [NSString stringWithFormat: @"--%@\r\nContent-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\nContent-Type: %@\r\nContent-Transfer-Encoding: binary\r\n\r\n", boundary, thisDataObject[@"name"], thisDataObject[@"filename"], thisDataObject[@"mimetype"]];
.......... }