Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Patched issue #263 (if needed) #268

Merged
merged 2 commits into from

2 participants

@ikarius

ASIFormDataRequest has a default 'GET' method (should be 'POST' by
default)

@ikarius ikarius Issue #263
ASIFormDataRequest has a default 'GET' method (should be 'POST' by
default)
f117953
Classes/ASIFormDataRequest.m
@@ -49,6 +49,7 @@
self = [super initWithURL:newURL];
[self setPostFormat:ASIURLEncodedPostFormat];
[self setStringEncoding:NSUTF8StringEncoding];
+ [self setRequestMethod:@"POST"];
@greenisus Collaborator

this looks great all around, but can you make the whitespace here consistent with the existing code?

@ikarius
ikarius added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@greenisus greenisus merged commit 4282568 into from
@greenisus
Collaborator

thanks again!

@ikarius

De nada !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 6, 2011
  1. @ikarius

    Issue #263

    ikarius authored
    ASIFormDataRequest has a default 'GET' method (should be 'POST' by
    default)
Commits on Oct 7, 2011
  1. @ikarius

    Correct indent

    ikarius authored
This page is out of date. Refresh to see the latest.
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"]];
Something went wrong with that request. Please try again.