then-request
Advanced tools
Comparing version 4.1.0 to 5.0.0
/// <reference types="node" /> | ||
import { HttpVerb } from 'http-basic/lib/HttpVerb'; | ||
import { Headers } from 'http-basic/lib/Headers'; | ||
import { IncomingHttpHeaders } from 'http'; | ||
import GenericResponse = require('http-response-object'); | ||
@@ -9,3 +9,3 @@ import { Options } from './Options'; | ||
declare type Response = GenericResponse<Buffer | string>; | ||
export { HttpVerb, Headers, Options, ResponsePromise, Response }; | ||
export { HttpVerb, IncomingHttpHeaders as Headers, Options, ResponsePromise, Response }; | ||
declare const fd: any; | ||
@@ -12,0 +12,0 @@ export { fd as FormData }; |
/// <reference types="node" /> | ||
import { HttpVerb } from 'http-basic/lib/HttpVerb'; | ||
import GenericResponse = require('http-response-object'); | ||
import { Headers } from 'http-basic/lib/Headers'; | ||
import { IncomingHttpHeaders } from 'http'; | ||
import { Options } from './Options'; | ||
import { ResponsePromise } from './ResponsePromise'; | ||
import { RequestFn } from './RequestFn'; | ||
import { HttpVerb } from 'http-basic'; | ||
import FormData = require('form-data'); | ||
declare type Response = GenericResponse<Buffer | string>; | ||
export { HttpVerb, Headers, Options, ResponsePromise, Response }; | ||
export { HttpVerb, IncomingHttpHeaders as Headers, Options, ResponsePromise, Response }; | ||
export { FormData }; | ||
declare const _default: RequestFn; | ||
export default _default; |
@@ -17,8 +17,8 @@ 'use strict'; | ||
var handle_qs_1 = require("./handle-qs"); | ||
var _basicRequest = require("http-basic"); | ||
var http_basic_1 = require("http-basic"); | ||
var FormData = require("form-data"); | ||
exports.FormData = FormData; | ||
var caseless = require('caseless'); | ||
var basicRequest = _basicRequest; | ||
var BufferBody = (function () { | ||
var basicRequest = http_basic_1["default"]; | ||
var BufferBody = /** @class */ (function () { | ||
function BufferBody(body, extraHeaders) { | ||
@@ -36,3 +36,3 @@ this._body = body; | ||
}()); | ||
var FormBody = (function () { | ||
var FormBody = /** @class */ (function () { | ||
function FormBody(body) { | ||
@@ -65,3 +65,3 @@ this._body = body; | ||
}()); | ||
var StreamBody = (function () { | ||
var StreamBody = /** @class */ (function () { | ||
function StreamBody(body) { | ||
@@ -163,2 +163,4 @@ this._body = body; | ||
return reject(err); | ||
if (!res) | ||
return reject(new Error('No request was received')); | ||
res.body.on('error', reject); | ||
@@ -165,0 +167,0 @@ res.body.pipe(concat(function (body) { |
/// <reference types="node" /> | ||
/// <reference types="form-data" /> | ||
import { Agent } from 'http'; | ||
import { Headers } from 'http-basic/lib/Headers'; | ||
import { ICache } from 'http-basic/lib/ICache'; | ||
import { IncomingHttpHeaders } from 'http'; | ||
import Response = require('http-response-object'); | ||
import { CachedResponse } from 'http-basic/lib/CachedResponse'; | ||
import { ICache, CachedResponse } from 'http-basic'; | ||
import FormData = require('form-data'); | ||
@@ -15,3 +14,3 @@ interface Options { | ||
gzip?: boolean; | ||
headers?: Headers; | ||
headers?: IncomingHttpHeaders; | ||
maxRedirects?: number; | ||
@@ -23,3 +22,3 @@ maxRetries?: number; | ||
timeout?: number; | ||
isMatch?: (requestHeaders: Headers, cachedResponse: CachedResponse, defaultValue: boolean) => boolean; | ||
isMatch?: (requestHeaders: IncomingHttpHeaders, cachedResponse: CachedResponse, defaultValue: boolean) => boolean; | ||
isExpired?: (cachedResponse: CachedResponse, defaultValue: boolean) => boolean; | ||
@@ -26,0 +25,0 @@ canCache?: (res: Response<NodeJS.ReadableStream>, defaultValue: boolean) => boolean; |
@@ -1,2 +0,2 @@ | ||
import { HttpVerb } from 'http-basic/lib/HttpVerb'; | ||
import { HttpVerb } from 'http-basic'; | ||
import { Options } from './Options'; | ||
@@ -3,0 +3,0 @@ import { ResponsePromise } from './ResponsePromise'; |
{ | ||
"name": "then-request", | ||
"version": "4.1.0", | ||
"version": "5.0.0", | ||
"description": "A request library that returns promises, inspired by request", | ||
@@ -20,4 +20,4 @@ "keywords": [], | ||
"form-data": "^2.2.0", | ||
"http-basic": "^5.0.3", | ||
"http-response-object": "^2.0.3", | ||
"http-basic": "^6.0.0", | ||
"http-response-object": "^3.0.1", | ||
"promise": "^8.0.0", | ||
@@ -24,0 +24,0 @@ "qs": "^6.4.0" |
@@ -9,2 +9,6 @@ # then-request | ||
<a target='_blank' rel='nofollow' href='https://app.codesponsor.io/link/gg9sZwctSLxyov1sJwW6pfyS/then/then-request'> | ||
<img alt='Sponsor' width='888' height='68' src='https://app.codesponsor.io/embed/gg9sZwctSLxyov1sJwW6pfyS/then/then-request.svg' /> | ||
</a> | ||
## Installation | ||
@@ -11,0 +15,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29560
423
135
+ Added@types/node@10.17.60(transitive)
+ Addedhttp-basic@6.0.0(transitive)
+ Addedhttp-response-object@3.0.2(transitive)
- Removedcaseless@0.11.0(transitive)
- Removedhttp-basic@5.0.3(transitive)
- Removedhttp-response-object@2.0.3(transitive)
Updatedhttp-basic@^6.0.0
Updatedhttp-response-object@^3.0.1