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

Frédéric VERGEZ Michael Mayo
Frédéric VERGEZ

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

Frédéric VERGEZ 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"];
Michael Mayo Collaborator

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

Frédéric VERGEZ
ikarius added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Michael Mayo greenisus merged commit 4282568 into from
Michael Mayo
Collaborator

thanks again!

Frédéric VERGEZ

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. Frédéric VERGEZ

    Issue #263

    ikarius authored
    ASIFormDataRequest has a default 'GET' method (should be 'POST' by
    default)
Commits on Oct 7, 2011
  1. Frédéric VERGEZ

    Correct indent

    ikarius authored
This page is out of date. Refresh to see the latest.
1  Classes/ASIFormDataRequest.m
View
@@ -49,6 +49,7 @@ - (id)initWithURL:(NSURL *)newURL
self = [super initWithURL:newURL];
[self setPostFormat:ASIURLEncodedPostFormat];
[self setStringEncoding:NSUTF8StringEncoding];
+ [self setRequestMethod:@"POST"];
return self;
}
2  Classes/Tests/ASIFormDataRequestTests.h
View
@@ -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
8 Classes/Tests/ASIFormDataRequestTests.m
View
@@ -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.