嗨当我使用jest客户端执行弹性搜索java API时,我面临以下错误
org.apache.http.client.ClientProtocolException:URI未指定有效的主机名:localhost:9200/index/type/_search
我尝试各种可能性来解决这个错误,但它不会有任何人指导我解决这个问题吗?.提前谢谢.
我正在使用node.js中的express框架.我想访问路径变量和查询参数.当我只使用路径变量它工作正常,但使用查询参数它将无法工作建议我在单个API中使用正确的解决方案.在这里我提到代码.
app.get('/user/:id', function (req, res, next) {
var url_parts = url.parse(req.url, true);
var type = url_parts.params.id;
Console.log('ID:', type);
next();
}, function (req, res, next) {
res.send('User Info');
});
Run Code Online (Sandbox Code Playgroud)