diff --git a/doc/api/http.md b/doc/api/http.md
index 3ca76cc92a598c..14b900ac55f035 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -1990,7 +1990,7 @@ When `request.url` is `'/status?name=ryan'` and
 
 ```console
 $ node
-> new URL(request.url, request.headers.host)
+> new URL(request.url, `http://${request.headers.host}`)
 URL {
   href: 'http://localhost:3000/status?name=ryan',
   origin: 'http://localhost:3000',