Socket
Socket
Sign inDemoInstall

httpsnippet

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpsnippet - npm Package Compare versions

Comparing version 1.0.0-beta.3 to 1.0.0-beta.4

2

package.json
{
"version": "1.0.0-beta.3",
"version": "1.0.0-beta.4",
"name": "httpsnippet",

@@ -4,0 +4,0 @@ "description": "HTTP Request snippet generator for *most* languages",

@@ -38,6 +38,13 @@ 'use strict';

// request body
if (this.source.postData) {
code.push(util.format('%s %s', opts.short ? '-d' : '--data', JSON.stringify(this.source.postData.text)));
if (this.source.postData && this.source.postData.text) {
code.push(util.format('%s %s', opts.short ? '-F' : '--form', JSON.stringify(this.source.postData.text)));
}
// construct post params
if (this.source.postData && !this.source.postData.text && this.source.postData.params && this.source.postData.params.length) {
this.source.postData.params.map(function (param) {
code.push(util.format('%s "%s=%s"', opts.short ? '-d' : '--data', param.name, param.value));
});
}
return code.join(opts.indent !== false ? ' \\\n' + opts.indent : ' ');

@@ -44,0 +51,0 @@ };

@@ -24,3 +24,3 @@ 'use strict';

// start with body pipe
if (this.source.postData) {
if (this.source.postData && this.source.postData.text) {
code.push(util.format('echo %s | ', JSON.stringify(this.source.postData.text)));

@@ -90,2 +90,9 @@ }

// construct post params
if (this.source.postData && !this.source.postData.text && this.source.postData.params && this.source.postData.params.length) {
this.source.postData.params.map(function (param) {
code.push(util.format('%s:%s', param.name, param.value));
});
}
// construct headers

@@ -92,0 +99,0 @@ if (this.source.headers && this.source.headers.length) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc