Last active
June 3, 2023 15:56
-
-
Save faisal00813/c8028de3e4a37f1ce92edc443d3aba8c to your computer and use it in GitHub Desktop.
Revisions
-
faisal00813 revised this gist
Nov 21, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,6 @@ request.post( // "author": "", // "license": "ISC", // "dependencies": { // "msgpack-lite": "^0.1.26", // "request": "^2.83.0" // } -
faisal00813 revised this gist
Nov 21, 2017 . No changes.There are no files selected for viewing
-
faisal00813 revised this gist
Nov 21, 2017 . 1 changed file with 22 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,4 +24,25 @@ request.post( return console.error('upload failed:', err); } console.log('Upload successful! Server responded with:', msgpack.decode(body)); }); // package.json // ---------- // { // "name": "msgpack_webserver", // "version": "1.0.0", // "description": "", // "main": "index.js", // "scripts": { // "test": "echo \"Error: no test specified\" && exit 1" // }, // "author": "", // "license": "ISC", // "dependencies": { // "express": "^4.16.2", // "msgpack-lite": "^0.1.26", // "request": "^2.83.0" // } // }
-
faisal00813 revised this gist
Nov 21, 2017 . No changes.There are no files selected for viewing
-
faisal00813 created this gist
Nov 21, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ const request = require('request') const msgpack = require("msgpack-lite"); var packedData = msgpack.encode({ "str" : "Something", "number" : 4.0, "arr": ["one","two"], "nClass": { "doubleNumber" : 35.0, "nums" : [34,23] }, "bool":true }); request.post( { url:'http://localhost:9000/user/msgPackTest', headers: { 'content-type': 'application/octet-stream' }, body: packedData, encoding: null }, function optionalCallback(err, httpResponse, body) { if (err) { return console.error('upload failed:', err); } console.log('Upload successful! Server responded with:', msgpack.decode(body)); });