1
首先,據我所知,有一些可以使用的模塊(https://www.npmjs.com/package/elasticsearch),但是我正在尋找一種方法使用的是Node.js來解決這個構建模塊。如何使身體GET請求
我正在尋找辦法做到在使用http模塊中的NodeJS以下捲曲要求:
來源:https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-count.html
curl -XGET 'http://localhost:9200/twitter/tweet/_count' -d '
{
"query" : {
"term" : { "user" : "kimchy" }
}
}'
E.g,使得與請求主體的請求。 https://nodejs.org/api/http.html#http_http_request_options_callback
req.write(parsedData);
數據事件是無關緊要的,我想你missunderstood的問題。 – superhero
我需要發送一個請求體中的問題描述,equalent到捲曲標誌'-d':https://curl.haxx.se/docs/manpage.html#-d – superhero
相關:HTTP://計算器.COM /問題/ 978061/HTTP-GET-與請求體 – superhero