|
@ -4,6 +4,7 @@ var https = require('https'); |
|
|
var urlLib = require('url'); |
|
|
var urlLib = require('url'); |
|
|
var util = require('util'); |
|
|
var util = require('util'); |
|
|
var zlib = require('zlib'); |
|
|
var zlib = require('zlib'); |
|
|
|
|
|
var querystring = require('querystring'); |
|
|
var objectAssign = require('object-assign'); |
|
|
var objectAssign = require('object-assign'); |
|
|
var infinityAgent = require('infinity-agent'); |
|
|
var infinityAgent = require('infinity-agent'); |
|
|
var duplexify = require('duplexify'); |
|
|
var duplexify = require('duplexify'); |
|
@ -92,6 +93,10 @@ function got(url, opts, cb) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (opts.query) { |
|
|
|
|
|
arg.path = (arg.path ? arg.path.split('?')[0] : '') + '?' + (typeof opts.query === 'string' ? opts.query : querystring.stringify(opts.query)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var req = fn.request(arg, function (response) { |
|
|
var req = fn.request(arg, function (response) { |
|
|
var statusCode = response.statusCode; |
|
|
var statusCode = response.statusCode; |
|
|
var res = response; |
|
|
var res = response; |
|
|