Skip to content

Commit

Permalink
Curl command generation: don't send data parameter if there are no fo…
Browse files Browse the repository at this point in the history
…rm params defined
  • Loading branch information
mmattozzi committed May 22, 2016
1 parent c229a0a commit 5157e24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion request/CRCRequest.m
Expand Up @@ -158,7 +158,7 @@ - (NSString *) generateCurlCommand:(bool)followRedirects {
for (NSDictionary *param in params) {
[command appendString:[NSString stringWithFormat:@"-F '%@=%@' ", [param valueForKey:@"key"], [param valueForKey:@"value"]]];
}
} else if (! rawRequestInput) {
} else if (! rawRequestInput && [params count] > 0) {
[command appendString:[NSString stringWithFormat:@"-d '%@' ",
[[NSString alloc] initWithData:[CRCFormEncodedRequest createRequestBody:params] encoding:NSUTF8StringEncoding]]];
}
Expand Down

0 comments on commit 5157e24

Please sign in to comment.