Skip to content

Documentation does not help the request user #55

@john-aws

Description

@john-aws

The request package suggests that:

If you'd like request to return a Promise instead, you can use an alternative interface wrapper for request.

It then proceeds to suggest request-promise-native for native Promises.

The problem is that the request-promise-native package's documentation is minimal, and will probably mislead most request users who are simply looking to promisify their code.

Specific examples include:

  • the documentation says that you need to npm install both request and request-promise-native, but then fails to indicate that your code should require('request-promise-native') rather than require('request'). This might seem minor, but it's likely to be very confusing to newcomers from request.
  • the API appears to be quite different, but there is no documentation to this effect. For example, to retrieve content-type from request.head is rc.headers.get('content-type') but with request-promise-native is rc['content-type']

As it stands, I suspect the casual request user would be better-served by simply using util.promisify. It would be good to write some basic documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions