lightning-request-net
Advanced tools
Comparing version 0.0.1-beta.4 to 0.0.1-beta.5
@@ -39,3 +39,3 @@ const Connection = require('./connection'); | ||
const headers = Object.assign({}, this.defaultHeaders, options.headers || {}); | ||
const responseType = options.responseType || 'text'; | ||
const responseType = options.responseType || 'json'; | ||
const timeout = options.timeout || 3000; | ||
@@ -42,0 +42,0 @@ |
{ | ||
"name": "lightning-request-net", | ||
"version": "0.0.1-beta.4", | ||
"version": "0.0.1-beta.5", | ||
"description": "Lightweight Node.js HTTP client based on net.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -46,8 +46,8 @@ ⚡ Lightweight Node.js HTTP client based on net. | ||
{ | ||
// `method` is the request method to be used when making the request | ||
method: 'get', // default | ||
// `path` is the server URL that will be used for the request | ||
path: '/foo', | ||
// `method` is the request method to be used when making the request | ||
method: 'get', // default | ||
// `headers` are custom headers to be sent | ||
@@ -61,5 +61,9 @@ headers: {'Content-Type': 'application/json'}, | ||
// `timeout` specifies the number of milliseconds before the request times out. | ||
// If the request takes longer than `timeout`, the request will be aborted. | ||
timeout: 3000, // default is `3000` milliseconds | ||
// `responseType` indicates the type of data that the server will respond with | ||
// options are: 'json', 'text' | ||
responseType: 'text', // default | ||
responseType: 'json', // default | ||
} | ||
@@ -66,0 +70,0 @@ ``` |
27901
13
103