nodejs / nodejs/undici

Documentation: RequestOptions

Open
#1,011 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Docs
Dominant language
JavaScript
Stars
7.7k
Forks
880
Avg merge
2d 16h
Merged PRs (30d)
68

Description

Bug Description

Documentation about RequestOptions is inconsistent.

Reproducible By

Comparing the following:

https://github.com/nodejs/undici#undicirequesturl-options-promise
image

https://github.com/nodejs/undici/blob/main/docs/api/Dispatcher.md#parameter-requestoptions
image

https://github.com/nodejs/undici/blob/main/docs/api/Dispatcher.md#parameter-dispatchoptions
image

https://github.com/nodejs/undici/blob/main/types/api.d.ts#L16
image

Expected Behavior

Expected consistent types in code and in documentation. Specifically, are we allowed to specify origin and path in the options object passed as the second argument to request and friends? Why or why not?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the RequestOptions and DispatchOptions sections in docs/api/Dispatcher.md with the request API documentation and the RequestOptions definition in types/api.d.ts. Determine whether origin and path are supported in the options passed to request and related methods. Done means the documentation and TypeScript types consistently describe the supported options and explain any restriction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.