I'm trying to get list of 5 cities in a country (Ex: United States) by using HTTP Post Request to get the cities from this website:
http://www.webservicex.net/globalweather.asmx?op=GetCitiesByCountry
This is the library that I use: https://www.npmjs.com/package/http-post
This is what I've got so far but it doesn't seem to work:
var http = require('http');
http.post = require('http-post');
var url = 'http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry';
var CountryName = 'United States';
http.post (url, CountryName, function(res) {
res.setEncoding('utf8');
res.on('data', function(chunk) {
console.log(chunk);
});
});