Set json
to the data you want to send, not form
:
request.post({
url: 'https://api.github.com/user/repos',
headers:{
'User-Agent': 'git CL - node',
'Content-type': 'application/json'
},
auth:{
username: '-username-',
password: '-password-'
},
json:{
name: "a-new-repo"
},
}, function(err, res, body){
console.log(body);
});