Created
May 24, 2011 04:49
-
-
Save russelyang/988154 to your computer and use it in GitHub Desktop.
TP mobile login module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'); | |
var user = { | |
name : "", | |
password : "", | |
token : 'd0be5f82-44c8-4686-aa13-c58e8ee910b7' | |
}; | |
var options = { | |
host : 'tpoitgf8i.tpolab.com', | |
port : 443, | |
path : '/dataservice/login.svc/Login', | |
method : 'POST', | |
headers : { | |
'content-type' : 'application/json; charset=UTF-8' | |
} | |
}; | |
var req = https.request(options, function(res) { | |
console.log("statusCode: ", res.statusCode); | |
console.log("headers: ", res.headers); | |
res.on('data', function(d) { | |
process.stdout.write(d); | |
}); | |
}); | |
req.write(JSON.stringify(user)); | |
req.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment