Skip to content

wreckvshttp-2

BSD-3-Clause 4 7 378
300.2 thousand (month) Aug 06 2011 18.1.0(2025-07-24 23:01:15 ago)
908 6 2 MIT
Sep 25 2013 183.8 thousand (month) 1.1.3(2026-03-05 00:04:35 ago)

Wreck is an HTTP client library for Node.js. It provides a simple, consistent API for making HTTP requests, including support for both the client and server side of an HTTP transaction.

Wreck is a very minimal but stable as it's part of Hapi web framework project. For web scraping, it doesn't offer required features like proxy configuration or http2 support so it's not recommended.

Pure Ruby, framework and transport agnostic, implementation of HTTP/2 protocol and HPACK header compression with support for:

  • Binary framing parsing and encoding
  • Stream multiplexing and prioritization
  • Connection and stream flow control
  • Header compression and server push
  • Connection and stream management
  • And more... see API docs

Protocol specifications:

  • Hypertext Transfer Protocol Version 2 (RFC 7540)
  • HPACK: Header Compression for HTTP/2 (RFC 7541)

Highlights


http2

Example Use


```javascript const Wreck = require('wreck'); // get request Wreck.get('http://example.com', (err, res, payload) => { if (err) { throw err; } console.log(payload.toString()); }); // post request const options = { headers: { 'content-type': 'application/json' }, payload: JSON.stringify({ name: 'John Doe' }) }; Wreck.post('http://example.com', options, (err, res, payload) => { if (err) { throw err; } console.log(payload.toString()); }); ```
```ruby require 'http/2' # GET request client = HTTP2::Client.new response = client.get("https://httpbin.org/get") puts response.body # POST reuqest data = { name: "value" } response = client.post("https://www.example.com", data) ```

Alternatives / Similar


Was this page helpful?