Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var qs = require("querystring");
- var http = require("http");
- var options = {
- "method": "POST",
- "hostname": [
- "192",
- "168",
- "0",
- "20"
- ],
- "path": [
- "update"
- ],
- "headers": {
- "Content-Type": "application/x-www-form-urlencoded",
- "cache-control": "no-cache",
- "Postman-Token": "34144980-756e-401b-8f32-088f5ddfa04b"
- }
- };
- var req = http.request(options, function (res) {
- var chunks = [];
- res.on("data", function (chunk) {
- chunks.push(chunk);
- });
- res.on("end", function () {
- var body = Buffer.concat(chunks);
- console.log(body.toString());
- });
- });
- req.write(qs.stringify({ mode: 'ON',
- colorOne: 'new one',
- colorTwo: 'new two',
- colorThree: 'new three',
- colorFour: 'new four',
- delayTime: '200',
- undefined: undefined }));
- req.end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement