Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dazn/lambda-powertools-http-client

Package Overview
Dependencies
Maintainers
6
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dazn/lambda-powertools-http-client - npm Package Compare versions

Comparing version 1.16.1 to 1.17.0

__tests__/request.js

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [1.17.0](https://github.com/getndazn/dazn-lambda-powertools/compare/v1.16.1...v1.17.0) (2020-01-02)
### Features
* **http-client:** add support for patch and url option ([6e70261](https://github.com/getndazn/dazn-lambda-powertools/commit/6e70261))
## [1.16.1](https://github.com/getndazn/dazn-lambda-powertools/compare/v1.16.0...v1.16.1) (2020-01-02)

@@ -8,0 +19,0 @@

15

index.js

@@ -29,2 +29,4 @@ const CorrelationIds = require('@dazn/lambda-powertools-correlation-ids')

return HTTP.del(uri)
case 'patch':
return HTTP.patch(uri)
default:

@@ -64,4 +66,4 @@ throw new Error(`unsupported method : ${method.toLowerCase()}`)

// options: {
// uri : string
// method : GET (default) | POST | PUT | HEAD
// uri/url : string (either uri or url must be specified)
// method : GET (default) | POST | PUT | HEAD | DELETE | PATCH
// headers : object

@@ -80,4 +82,5 @@ // qs : object

if (!options.uri) {
throw new Error('no HTTP uri is specified')
const uri = options.uri || options.url
if (!uri) {
throw new Error('no HTTP uri or url is specified')
}

@@ -91,3 +94,3 @@

const method = options.method || 'get'
let request = getRequest(options.uri, method)
let request = getRequest(uri, method)

@@ -103,3 +106,3 @@ request = setHeaders(request, headers)

const start = Date.now()
const url = new URL.URL(options.uri)
const url = new URL.URL(uri)
const metricName = options.metricName || url.hostname + '.response'

@@ -106,0 +109,0 @@ const requestMetricTags = [

4

package.json
{
"name": "@dazn/lambda-powertools-http-client",
"version": "1.16.1",
"version": "1.17.0",
"description": "HTTP client that supports forwarding correlation IDs (captured via @dazn/lambda-powertools-correlation-ids) and auto-records metrics",

@@ -23,3 +23,3 @@ "main": "index.js",

},
"gitHead": "d5878da408ee060b4bfef3326105dae6db00e79e"
"gitHead": "cee461519ff6ca3cfd8498943602866d3a56cc85"
}

@@ -51,4 +51,4 @@ # lambda-powertools-http-client

{
uri : string
method : GET (default) | POST | PUT | HEAD
uri/url : string (either uri or url must be specified)
method : GET (default) | POST | PUT | HEAD | DELETE | PATCH
headers : object

@@ -55,0 +55,0 @@ qs : object

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