Browse files

Merge pull request #268 from ikarius/master

Patched issue #263 (if needed)
  • Loading branch information...
2 parents c27b8f5 + 5e7e106 commit 4282568eec0b487a98e312ce49b523350ffa4a6b @greenisus greenisus committed Oct 7, 2011
View
1 Classes/ASIFormDataRequest.m
@@ -49,6 +49,7 @@ - (id)initWithURL:(NSURL *)newURL
self = [super initWithURL:newURL];
[self setPostFormat:ASIURLEncodedPostFormat];
[self setStringEncoding:NSUTF8StringEncoding];
+ [self setRequestMethod:@"POST"];
return self;
}
View
2 Classes/Tests/ASIFormDataRequestTests.h
@@ -12,11 +12,13 @@
float progress;
}
+- (void)testDefaultMethod;
- (void)testPostWithFileUpload;
- (void)testEmptyData;
- (void)testSubclass;
- (void)testURLEncodedPost;
- (void)testCharset;
- (void)testPUT;
- (void)testCopy;
+
@end
View
8 Classes/Tests/ASIFormDataRequestTests.m
@@ -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"]];

0 comments on commit 4282568

Please sign in to comment.