0
searchJSON = {
location: 'NYC',
text: text,
authID: apiKey
};
searchRequest = {
host: siteUrl,
port: 80,
path: '/search',
method: 'GET'
};
searchResponse = makeRequest(searchRequest, searchJSON);
makeRequest = function(options, data) {
var req;
if (typeof data !== 'string') {
data = JSON.stringify(data);
}
req = http.get(options, function(res) {
var body;
body = '';
res.on('data', function(chunk) {
body += chunk;
});
return res.on('end', function() {
console.log(body);
});
});
console.log(data);
req.write(data);
req.end();
};
http://www.somesite.com/search?location=NYC&text=text&authID=[mykey]
にする必要はありませんか?ExpressJSが要求コマンドを正しく実行できないのはなぜですか?
動作する基本的な要求メソッドです。 –