Skip to content

Commit

Permalink
Use single quote for cur data param
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmike committed Oct 26, 2015
1 parent 9fd48e6 commit 85ac06f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ok2curl/src/main/java/com/moczul/ok2curl/CurlBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

private static final String FORMAT_HEADER = "-H \"%1$s:%2$s\"";
private static final String FORMAT_METHOD = "-X %1$s";
private static final String FORMAT_BODY = "-d \"%1$s\"";
private static final String FORMAT_BODY = "-d '%1$s'";

private final String url;
private String method;
Expand Down
4 changes: 2 additions & 2 deletions ok2curl/src/test/java/com/moczul/ok2curl/CurlBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void postRequest_hasCorrectPostData() {
final Request request = new Request.Builder().url("http://example.com/").post(body()).build();
final String command = new CurlBuilder(request).build();

final String expected = "curl -X POST -H \"Content-Type:application/x-www-form-urlencoded\" -d \"key1=value1\" http://example.com/";
final String expected = "curl -X POST -H \"Content-Type:application/x-www-form-urlencoded\" -d 'key1=value1' http://example.com/";
assertEquals(expected, command);
}

Expand All @@ -64,7 +64,7 @@ public void postRequest_bodyWithNullMediaType() {
final Request request = new Request.Builder().url("http://example.com/").post(body).build();
final String command = new CurlBuilder(request).build();

final String expected = "curl -X POST -d \"StringBody\" http://example.com/";
final String expected = "curl -X POST -d 'StringBody' http://example.com/";
assertEquals(expected, command);
}

Expand Down

0 comments on commit 85ac06f

Please sign in to comment.