Skip to content

Commit

Permalink
Merge pull request pokeb#268 from ikarius/master
Browse files Browse the repository at this point in the history
Patched issue pokeb#263 (if needed)
  • Loading branch information
greenisus committed Oct 7, 2011
2 parents c27b8f5 + 5e7e106 commit 4282568
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions Classes/ASIFormDataRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ - (id)initWithURL:(NSURL *)newURL
self = [super initWithURL:newURL];
[self setPostFormat:ASIURLEncodedPostFormat];
[self setStringEncoding:NSUTF8StringEncoding];
[self setRequestMethod:@"POST"];
return self;
}

Expand Down
2 changes: 2 additions & 0 deletions Classes/Tests/ASIFormDataRequestTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
float progress;
}

- (void)testDefaultMethod;
- (void)testPostWithFileUpload;
- (void)testEmptyData;
- (void)testSubclass;
- (void)testURLEncodedPost;
- (void)testCharset;
- (void)testPUT;
- (void)testCopy;

@end
8 changes: 8 additions & 0 deletions Classes/Tests/ASIFormDataRequestTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ @implementation ASIFormDataRequestSubclass;

@implementation ASIFormDataRequestTests


-(void)testDefaultMethod
{
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString:@"http://wedontcare.com"]] autorelease];

GHAssertTrue([[request requestMethod] isEqualToString:@"POST"], @"Default request method should be POST");
}

- (void)testAddNilKeysAndValues
{
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://allseeing-i.com/ASIHTTPRequest/tests/empty-post-value"]];
Expand Down

0 comments on commit 4282568

Please sign in to comment.