Closed
Description
📗 API Reference Docs Problem
Location
API Reference DOCS: (HTTP) http.request(url[, options][, callback])
Affected URL(s):
Description
The first sample code in this item throws an error (ReferenceError) regarding two undefined constants. The first one is 'querystring' on line #1 and the second one is 'http' on line #16. Both are undeclared.
Please view attached screenshot
Actually, both errors can be fixed if the aforementioned lines are updated to:
Line #1
const postData = JSON.stringify({
Line #16
const req = require('http').request(options, (res) => {
An alternative fix for Line #16 could also be leaving as it is, but declaring the constant in the beginning of the code:
const http = require('http');
Screenshot
- I would like to work on this issue and
submit a pull request.