Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #263

ASIFormDataRequest has a default 'GET' method (should be 'POST' by
default)
  • Loading branch information...
commit f1179537e725e007fa9472da5c371528aeeb4675 1 parent 6600374
@ikarius authored
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,6 +12,7 @@
float progress;
}
+- (void)testDefaultMethod;
- (void)testPostWithFileUpload;
- (void)testEmptyData;
- (void)testSubclass;
@@ -19,4 +20,5 @@
- (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"]];
Please sign in to comment.
Something went wrong with that request. Please try again.