Skip to content

doc: update http.md for consistency

The HTTP Keep-Alive text was inconsistent. These changes follow the following rules

  • When referring to flag used in code, it should always be written using backticks and in camel case. E.g. keepAlive.
  • When referring to the mechanism Keep-Alive functionality as described in the HTTP 1.1 RFC, it is written as 'HTTP Keep-Alive', without the use of backticks.
  • When referring to the request header, it should always use backticks and be written as Connection: keep-alive.

This commit also includes some changes to how http.Agent is referenced. When Agent is used as a reference to an object or instance, backticks should always be used.

Left somewhat unresolved is how to determine when to use "agent" vs. "Agent". At the moment, the API documentation typically uses "agent" when referring to a generic instance, and either http.Agent or Agent when referring to a specific instance. But it's not really 100% clear. I wonder if it would be best to just always use Agent.

Ref: https://github.com/nodejs/node/pull/10614 Fixes: https://github.com/nodejs/node/issues/10567

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

Merge request reports

Loading