File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,13 +34,13 @@ module.exports = function (options) {
3434
3535 // request body
3636 if ( this . source . postData . text ) {
37- code . push ( util . format ( '%s %s' , opts . short ? '-F ' : '--form ' , JSON . stringify ( this . source . postData . text ) ) ) ;
37+ code . push ( util . format ( '%s %s' , opts . short ? '-d ' : '--data ' , JSON . stringify ( this . source . postData . text ) ) ) ;
3838 }
3939
4040 // construct post params
4141 if ( ! this . source . postData . text && this . source . postData . params && this . source . postData . params . length ) {
4242 this . source . postData . params . map ( function ( param ) {
43- code . push ( util . format ( '%s "%s=%s"' , opts . short ? '-d ' : '--data ' , param . name , param . value ) ) ;
43+ code . push ( util . format ( '%s "%s=%s"' , opts . short ? '-F ' : '--form ' , param . name , param . value ) ) ;
4444 } ) ;
4545 }
4646
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ describe('cURL', function () {
1111 } ) ;
1212
1313 result . should . be . a . String ;
14- result . should . eql ( 'curl --request POST --url "http://mockbin.com/request?foo=bar" --header "Content-Type: application/json" --cookie "bar=baz" --form "{\\"foo\\": \\"bar\\"}"' ) ;
14+ result . should . eql ( 'curl --request POST --url "http://mockbin.com/request?foo=bar" --header "Content-Type: application/json" --cookie "bar=baz" --data "{\\"foo\\": \\"bar\\"}"' ) ;
1515
1616 done ( ) ;
1717 } ) ;
@@ -23,7 +23,7 @@ describe('cURL', function () {
2323 } ) ;
2424
2525 result . should . be . a . String ;
26- result . should . eql ( 'curl -X POST "http://mockbin.com/request?foo=bar" -H "Content-Type: application/json" -b "bar=baz" -F "{\\"foo\\": \\"bar\\"}"' ) ;
26+ result . should . eql ( 'curl -X POST "http://mockbin.com/request?foo=bar" -H "Content-Type: application/json" -b "bar=baz" -d "{\\"foo\\": \\"bar\\"}"' ) ;
2727
2828 done ( ) ;
2929 } ) ;
@@ -45,7 +45,7 @@ describe('cURL', function () {
4545 } ) ;
4646
4747 result . should . be . a . String ;
48- result . replace ( / \\ \n / g, '' ) . should . eql ( 'curl --request POST @--url "http://mockbin.com/request?foo=bar" @--header "Content-Type: application/json" @--cookie "bar=baz" @--form "{\\"foo\\": \\"bar\\"}"' ) ;
48+ result . replace ( / \\ \n / g, '' ) . should . eql ( 'curl --request POST @--url "http://mockbin.com/request?foo=bar" @--header "Content-Type: application/json" @--cookie "bar=baz" @--data "{\\"foo\\": \\"bar\\"}"' ) ;
4949
5050 done ( ) ;
5151 } ) ;
You can’t perform that action at this time.
0 commit comments