mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 23:28:33 -04:00
37 lines
620 B
JavaScript
Executable File
37 lines
620 B
JavaScript
Executable File
var http = require('http');
|
|
|
|
var options = {
|
|
method: 'POST',
|
|
hostname: 'mockbin.com',
|
|
port: null,
|
|
path: '/har',
|
|
headers: {
|
|
'content-type': 'application/json'
|
|
}
|
|
};
|
|
|
|
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(
|
|
JSON.stringify({
|
|
number: 1,
|
|
string: 'f"oo',
|
|
arr: [1, 2, 3],
|
|
nested: { a: 'b' },
|
|
arr_mix: [1, 'a', { arr_mix_nested: {} }],
|
|
boolean: false
|
|
})
|
|
);
|
|
req.end();
|