Showing
1 changed file
with
9 additions
and
2 deletions
| @@ -23,20 +23,27 @@ | @@ -23,20 +23,27 @@ | ||
| 23 | [data writeToFile:path atomically:NO]; | 23 | [data writeToFile:path atomically:NO]; |
| 24 | 24 | ||
| 25 | ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease]; | 25 | ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease]; |
| 26 | + | ||
| 27 | + NSDate *d = [NSDate new]; | ||
| 28 | + NSValue *v = [NSValue valueWithRect:NSMakeRect(0, 0, 200, 200)]; | ||
| 26 | [request setPostValue:@"foo" forKey:@"post_var"]; | 29 | [request setPostValue:@"foo" forKey:@"post_var"]; |
| 30 | + [request setPostValue:d forKey:@"post_var2"]; | ||
| 31 | + [request setPostValue:v forKey:@"post_var3"]; | ||
| 27 | [request setFile:path forKey:@"file"]; | 32 | [request setFile:path forKey:@"file"]; |
| 28 | [request start]; | 33 | [request start]; |
| 29 | 34 | ||
| 30 | - BOOL success = ([[request dataString] isEqualToString:[NSString stringWithFormat:@"post_var: %@\r\nfile_name: %@\r\nfile_size: %hu",@"foo",@"bigfile",size]]); | 35 | + BOOL success = ([[request dataString] isEqualToString:[NSString stringWithFormat:@"post_var: %@\r\npost_var2: %@\r\npost_var3: %@\r\nfile_name: %@\r\nfile_size: %hu",@"foo",d,v,@"bigfile",size]]); |
| 31 | STAssertTrue(success,@"Failed to upload the correct data (using local file)"); | 36 | STAssertTrue(success,@"Failed to upload the correct data (using local file)"); |
| 32 | 37 | ||
| 33 | //Try the same with the raw data | 38 | //Try the same with the raw data |
| 34 | request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease]; | 39 | request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease]; |
| 35 | [request setPostValue:@"foo" forKey:@"post_var"]; | 40 | [request setPostValue:@"foo" forKey:@"post_var"]; |
| 41 | + [request setPostValue:d forKey:@"post_var2"]; | ||
| 42 | + [request setPostValue:v forKey:@"post_var3"]; | ||
| 36 | [request setData:data forKey:@"file"]; | 43 | [request setData:data forKey:@"file"]; |
| 37 | [request start]; | 44 | [request start]; |
| 38 | 45 | ||
| 39 | - success = ([[request dataString] isEqualToString:[NSString stringWithFormat:@"post_var: %@\r\nfile_name: %@\r\nfile_size: %hu",@"foo",@"file",size]]); | 46 | + success = ([[request dataString] isEqualToString:[NSString stringWithFormat:@"post_var: %@\r\npost_var2: %@\r\npost_var3: %@\r\nfile_name: %@\r\nfile_size: %hu",@"foo",d,v,@"file",size]]); |
| 40 | STAssertTrue(success,@"Failed to upload the correct data (using NSData)"); | 47 | STAssertTrue(success,@"Failed to upload the correct data (using NSData)"); |
| 41 | } | 48 | } |
| 42 | 49 |
-
Please register or login to post a comment