SHARE
TWEET

Untitled

a guest Feb 20th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var qs = require("querystring");
  2. var http = require("http");
  3.  
  4. var options = {
  5.   "method": "POST",
  6.   "hostname": [
  7.     "192",
  8.     "168",
  9.     "0",
  10.     "20"
  11.   ],
  12.   "path": [
  13.     "update"
  14.   ],
  15.   "headers": {
  16.     "Content-Type": "application/x-www-form-urlencoded",
  17.     "cache-control": "no-cache",
  18.     "Postman-Token": "34144980-756e-401b-8f32-088f5ddfa04b"
  19.   }
  20. };
  21.  
  22. var req = http.request(options, function (res) {
  23.   var chunks = [];
  24.  
  25.   res.on("data", function (chunk) {
  26.     chunks.push(chunk);
  27.   });
  28.  
  29.   res.on("end", function () {
  30.     var body = Buffer.concat(chunks);
  31.     console.log(body.toString());
  32.   });
  33. });
  34.  
  35. req.write(qs.stringify({ mode: 'ON',
  36.   colorOne: 'new one',
  37.   colorTwo: 'new two',
  38.   colorThree: 'new three',
  39.   colorFour: 'new four',
  40.   delayTime: '200',
  41.   undefined: undefined }));
  42. req.end();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top