Skip to content

wreckvsexcon

BSD-3-Clause 4 7 378
300.2 thousand (month) Aug 06 2011 18.1.0(2025-07-24 23:01:15 ago)
1,172 19 20 MIT
Oct 31 2009 3.3 million (month) 1.4.2(2026-03-20 19:18:25 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.

Excon is a Ruby library for making HTTP requests. It is designed to be fast and efficient, and is often used as a building block for other Ruby libraries and frameworks.

One of the main features of Excon is its support for persistent connections, which allows it to reuse the same connection for multiple requests, reducing the overhead of establishing a new connection for each request.

Excon also supports streaming requests and responses, which allows you to read or write data to the server incrementally, without having to load the entire response into memory at once.

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 'excon' # GET requests response = Excon.get('https://jsonplaceholder.typicode.com/posts/1') puts response.body puts response.status puts response.headers # POST requests response = Excon.post('https://jsonplaceholder.typicode.com/posts', :body => { :title => 'foo', :body => 'bar', :userId => 1 }.to_json, :headers => { 'Content-Type' => 'application/json' } ) puts response.body ```

Alternatives / Similar


Was this page helpful?