We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 058a130 + e75aafd commit fc7720cCopy full SHA for fc7720c
1 file changed
src/targets/shell/curl.js
@@ -17,7 +17,8 @@ var CodeBuilder = require('../../helpers/code-builder')
17
module.exports = function (source, options) {
18
var opts = util._extend({
19
indent: ' ',
20
- short: false
+ short: false,
21
+ binary: false
22
}, options)
23
24
var code = new CodeBuilder(opts.indent, opts.indent !== false ? ' \\\n' + opts.indent : ' ')
@@ -56,7 +57,10 @@ module.exports = function (source, options) {
56
57
default:
58
// raw request body
59
if (source.postData.text) {
- 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
+ )
64
}
65
66
0 commit comments