mirror of
https://github.com/curlconverter/curlconverter.git
synced 2022-05-22 02:35:29 +03:00
17 lines
326 B
JavaScript
17 lines
326 B
JavaScript
var request = require('request');
|
|
|
|
var dataString = '{"title":"china1"}';
|
|
|
|
var options = {
|
|
url: 'http://example.com/post',
|
|
method: 'POST',
|
|
body: dataString
|
|
};
|
|
|
|
function callback(error, response, body) {
|
|
if (!error && response.statusCode == 200) {
|
|
console.log(body);
|
|
}
|
|
}
|
|
|
|
request(options, callback); |