Skip to content

Commit fc7720c

Browse files
committed
Merge pull request #77 from RogueBurger/master
Add option for --data-binary flag in curl
2 parents 058a130 + e75aafd commit fc7720c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/targets/shell/curl.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ var CodeBuilder = require('../../helpers/code-builder')
1717
module.exports = function (source, options) {
1818
var opts = util._extend({
1919
indent: ' ',
20-
short: false
20+
short: false,
21+
binary: false
2122
}, options)
2223

2324
var code = new CodeBuilder(opts.indent, opts.indent !== false ? ' \\\n' + opts.indent : ' ')
@@ -56,7 +57,10 @@ module.exports = function (source, options) {
5657
default:
5758
// raw request body
5859
if (source.postData.text) {
59-
code.push('%s %s', opts.short ? '-d' : '--data', helpers.escape(helpers.quote(source.postData.text)))
60+
code.push(
61+
'%s %s', opts.binary ? '--data-binary' : (opts.short ? '-d' : '--data'),
62+
helpers.escape(helpers.quote(source.postData.text))
63+
)
6064
}
6165
}
6266

0 commit comments

Comments
 (0)