🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

wreck

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wreck - npm Package Compare versions

Comparing version

to
7.1.0

6

lib/index.js

@@ -90,2 +90,8 @@ 'use strict';

const uri = Url.parse(url);
if (options.socketPath) {
uri.socketPath = options.socketPath;
delete options.socketPath;
}
uri.method = method.toUpperCase();

@@ -92,0 +98,0 @@ uri.headers = options.headers || {};

2

package.json
{
"name": "wreck",
"description": "HTTP Client Utilities",
"version": "7.0.2",
"version": "7.1.0",
"repository": "git://github.com/hapijs/wreck",

@@ -6,0 +6,0 @@ "main": "lib/index",

@@ -26,3 +26,3 @@ ![wreck Logo](https://raw.github.com/hapijs/wreck/master/images/wreck.png)

var method = 'GET'; // GET, POST, PUT, DELETE
var uri = 'https://google.com/';
var uri = '/';
var readableStream = Wreck.toReadableStream('foo=bar');

@@ -41,5 +41,3 @@

var options = {
baseUrl: fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain.
If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. Any
querystring in the `baseUrl` will be overwritten with the querystring in the `uri` When `baseUrl` is given, `uri` must also be a string.
baseUrl: "https://www.example.com",
payload: readableStream || 'foo=bar' || new Buffer('foo=bar'),

@@ -84,7 +82,8 @@ headers: { /* http headers */ },

following optional keys:
- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain.
If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. Any
querystring in the `baseUrl` will be overwritten with the querystring in the `uri` When `baseUrl` is given, `uri` must also be a string.
- `socketPath` - `/path/to/unix/socket` for Server.
- `payload` - The request body as string, Buffer, or Readable Stream.
- `headers` - An object containing request headers.
- `rejectUnauthorized` - [TLS](http://nodejs.org/api/tls.html) flag indicating
whether the client should reject a response from a server with invalid certificates. This cannot be set at the
same time as the `agent` option is set.
- `redirects` - The maximum number of redirects to follow.

@@ -100,6 +99,11 @@ - `beforeRedirect` - A callback function that is called before a redirect is triggered, using the signature function (redirectMethod, statusCode, location, redirectOptions) where:

- `req` - The new [ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) object which replaces the one initially returned.
- `timeout` - The number of milliseconds to wait without receiving a response
before aborting the request. Defaults to unlimited.
- `maxBytes` - maximum size for response payload. Defaults to unlimited.
- `rejectUnauthorized` - [TLS](http://nodejs.org/api/tls.html) flag indicating
whether the client should reject a response from a server with invalid certificates. This cannot be set at the
same time as the `agent` option is set.
- `downstreamRes`: downstream Resource dependency.
- `agent` - Node Core [http.Agent](http://nodejs.org/api/http.html#http_class_http_agent).
Defaults to either `wreck.agents.http` or `wreck.agents.https`. Setting to `false` disables agent pooling.
- `timeout` - The number of milliseconds to wait without receiving a response
before aborting the request. Defaults to unlimited.
- `secureProtocol` - [TLS](http://nodejs.org/api/tls.html) flag indicating the SSL method to use, e.g. `SSLv3_method`

@@ -106,0 +110,0 @@ to force SSL version 3. The possible values depend on your installation of OpenSSL. Read the official OpenSSL docs

Sorry, the diff of this file is too big to display