- Added
forever
option to setup theforever-agent
(to keep connections alive). - Added
gzip
option to optimize network usage and speed up requests. - Added
followRedirect
,followAllRedirects
andmaxRedirects
options to follow HTTP 3xx responses as redirects - Added
requestOptions
option, that allows to pass options torequest
module that are not covered by reqclient's options, likecert
,key
,proxy
,pool
, etc. - Improved the doc, added
async
/await
examples. - Updated dependencies (it's not necessary to update dependencies in projects with oldest versions).
- Added
fullResponse
option to return the full response instead of just the body.
- Fixed array parameters in "query" object parsed as unique param in URIs.
- Use to output logs
logger.info()
instead oflogger.log()
to be compliant with external loggers.
- Fixed OAuth2 login with unauthorized error response with JSON format are propagated as a string message error.
- Fixed OAuth2 token expiration check where there is no expiration defined.
- Fixed quote character used when system environment variables are used in cURL logging.
- Added HTTP Authentication support.
- Added OAuth2 Authentication support.
- Added full URL parameter support on each call.
- If
debugResponse
is activated and a response has HTTP Status >= 400 it will log witherror
severity. - Added an optional parameter
options
to all public method to override the default options.
_prepareOptions()
method now builds the request options in async mode returning aPromise
, useful to add options obtained from external resources without blocking the execution, like an access token from an OAuth server.- The new
options
parameter replace thecacheTtl
parameter in theget()
method. Now this parameter is a optional property inside theoptions
parameter (eg.{cacheTtl: 60, ...}
).
- Fixed mutable header issue.
- Fixed formData debug with
null
values.
- Improvements in
form
andformData
submits, useful to send files. - Use
encodeURIComponent()
to encode query parameters.
- Fixed query parameter binding issue.
- Minor fix in README.
- Added config option
encodeQuery
to encode "unsafe" characters in the URL query parameters. - Fixed cURL debug output to not add content-type header if it's a GET or DELETE request (no body present).
- Added cache support.
- Added default headers configuration.
- Refactor how config options is passed to the constructor class.
- Improvements in README docs.
- Fixed "DELETE" method.
- Fixed README docs
Initial source code.