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

http-client

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-client - npm Package Compare versions

Comparing version 4.3.0 to 4.3.1

2

package.json
{
"name": "http-client",
"version": "4.3.0",
"version": "4.3.1",
"description": "Compose HTTP clients using JavaScript's fetch API",

@@ -5,0 +5,0 @@ "repository": "mjackson/http-client",

@@ -27,6 +27,5 @@ # http-client [![Travis][build-badge]][build] [![npm package][npm-badge]][npm]

// using ES6 modules
import { fetch, createFetch } from 'http-client'
import { createFetch } from 'http-client'
// using CommonJS modules
var fetch = require('http-client').fetch
var createFetch = require('http-client').createFetch

@@ -73,3 +72,3 @@ ```

Returns an "enhanced" version of the given `fetch` function that uses an array of transforms in `options.responseHandlers` to modify the response after it is received. This is only really useful when using [stacks](#stacks) directly instead of the global `fetch` function.
Returns an "enhanced" version of the given `fetch` function that knows how to run response handlers registered using [`recv`](#recvhandler). This is only really useful when using [stacks](#stacks) directly instead of `createFetch`.

@@ -130,2 +129,19 @@ ## Middleware

#### `debug()`
Adds a `debug` property to the response or error object so you can inspect them. Mainly useful for testing/debugging (should run *after* all other middleware).
```js
import { createFetch, debug } from 'http-client'
const fetch = createFetch(
// ... other middleware
debug()
)
fetch(input).then(response => {
console.log(response.debug.input, response.debug.options)
})
```
#### `header(name, value)`

@@ -231,19 +247,2 @@

#### `requestInfo()`
Adds `requestURL` and `requestOptions` properties to the response (or error) object so you can inspect them. Mainly useful for testing/debugging (should be put last in the list of middleware).
```js
import { createFetch, requestInfo } from 'http-client'
const fetch = createFetch(
// ...
requestInfo()
)
fetch(input).then(response => {
console.log(response.requestURL, response.requestOptions)
})
```
## Stacks

@@ -250,0 +249,0 @@

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