Skip to content

Instantly share code, notes, and snippets.

@aclave1
Last active August 29, 2015 14:09
Show Gist options
  • Save aclave1/5f9248da79f6d5888a50 to your computer and use it in GitHub Desktop.
Save aclave1/5f9248da79f6d5888a50 to your computer and use it in GitHub Desktop.
job application for Envoc
var http = require('http');
var body = JSON.stringify({
Name:"OMITTED",
PhoneNumber: "OMITTED",
Email:"OMITTED",
Position:"Javascript Developer",
Urls:[
{
Type:'Resume',
Link:'OMITTED'
},
{
Type:'github',
Link:'https://github.com/aclave1'
},
{
Type:'the nodejs script used to create this request',
Link:'https://gist.github.com/aclave1/5f9248da79f6d5888a50'
}
]
});
var options = {
host:'careers.envoc.com',
path:'/api/apply',
port:80,
method:'POST',
headers:{
'Content-Type': 'application/json',
'Content-Length': body.length
}
};
var req = http.request(options,function(response){
var str = '';
console.log(response.statusCode);
response.on('data',function(chunk){
str += chunk;
});
response.on('end',function(){
console.log(str);
});
response.on('error',function(err){
console.log(err);
});
});
req.write(body);
req.end();
//basically just receives the job application http request and prints it out
var http = require('http');
http.createServer(function(req,res){
var str = '';
req.on('data',function(chunk){
str += chunk;
});
req.on('end',function(){
var ob = JSON.parse(str);
console.dir(ob);
});
res.write("congrats!");
res.end();
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment