Cli-microsoft365: Remove the deprecated request package

Created on 20 Feb 2020  路  1Comment  路  Source: pnp/cli-microsoft365

Since the request package has been deprecated, we should refactor the code to either use an alternative or standard Node.js functionality. The latter would be preferable to avoid unnecessary dependencies, but we need to verify if the effort to use the standard capabilities, which are often more verbose, outweigh the cost of an extra dependency.

Things to verify during the refactoring:

  • [x] GET
  • [x] POST
  • [x] PATCH
  • [x] PUT
  • [x] DELETE
  • [x] parsing objects to JSON strings in requests
  • [x] parsing JSON strings to objects in responses
  • [x] gzip compressing requests
  • [x] gzip decompressing responses
  • [x] setting additional request headers
  • [x] supporting promises
  • [x] automatically setting user agent on all requests
  • [x] automatically enabling compression on all requests
  • [x] automatically adding bearer token to all requests
  • [x] allowing anonymous requests
  • [x] support binary responses
  • [x] support specifying proxy

Ideally, the refactoring should be done in a way that doesn't require us to refactor all commands issuing requests.

enhancement work in progress

Most helpful comment

Having researched the problem, we won't be implementing any changes at this point as _request_ in its current form works just fine for us. So unless it's removed from npm or its dependencies will get stale/unsafe, we'll keep using it for the time being.

>All comments

Having researched the problem, we won't be implementing any changes at this point as _request_ in its current form works just fine for us. So unless it's removed from npm or its dependencies will get stale/unsafe, we'll keep using it for the time being.

Was this page helpful?
0 / 5 - 0 ratings