From e8b119e63699b4f2bd116f2f9cea299adb60ea0b Mon Sep 17 00:00:00 2001 From: "ali.ibrahim" Date: Wed, 2 Nov 2016 10:40:51 +0100 Subject: [PATCH 1/2] Formatting JavaScript sample code. --- docs/api/net.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api/net.md b/docs/api/net.md index e78cddbbd826..df26736c256a 100644 --- a/docs/api/net.md +++ b/docs/api/net.md @@ -104,7 +104,7 @@ strictly follow the Node.js model as described in the For instance, we could have created the same request to 'github.com' as follows: -```JavaScript +```javascript const request = net.request({ method: 'GET', protocol: 'https:', @@ -141,7 +141,7 @@ The `callback` function is expected to be called back with user credentials: * `username` String * `password` String -```JavaScript +```javascript request.on('login', (authInfo, callback) => { callback('username', 'password') }) @@ -150,7 +150,7 @@ request.on('login', (authInfo, callback) => { Providing empty credentials will cancel the request and report an authentication error on the response object: -```JavaScript +```javascript request.on('response', (response) => { console.log(`STATUS: ${response.statusCode}`); response.on('error', (error) => { From 49cb675057e6044ef8c107f39e10d6861959ef0b Mon Sep 17 00:00:00 2001 From: "ali.ibrahim" Date: Wed, 2 Nov 2016 11:16:37 +0100 Subject: [PATCH 2/2] Fixing a trivial js lint issue. --- docs/api/net.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/net.md b/docs/api/net.md index df26736c256a..30792cb26222 100644 --- a/docs/api/net.md +++ b/docs/api/net.md @@ -152,7 +152,7 @@ error on the response object: ```javascript request.on('response', (response) => { - console.log(`STATUS: ${response.statusCode}`); + console.log(`STATUS: ${response.statusCode}`) response.on('error', (error) => { console.log(`ERROR: ${JSON.stringify(error)}`) })