doc: modernize and fix code examples in http.md
Checklist
-
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
doc, http
- replace
var
byconst
- replace
let
byconst
- fix spaces in code examples
- replace
console.log()
byconsole.error()
- make arrow function clearer
- use object destructuring
- update output examples