I'm trying to make request with umlauts in URL parameters to get recommendations:
function getRecommendations(auth, callback) {
var params = '+"olivenöl"';
var host = 'something.com';
var path = "/solr/cloud/select?q=*&fq=ingredient_t:(" + params + ")";
var options = {
"host": host,
"path": path,
"method": 'GET',
"headers": {
"Authorization": auth,
"Content-Type": "application/json",
"Accept": "application/json",
}
};
http.request(options, function (res) {
res.setEncoding('utf8');
var body = '';
res.on('data', function (d) {
body += d;
});
res.on('end', function () {
callback(body);
});
});
}
Response has empty list of recommendations in a case if German umlauts present in URL params.
I tried to encode as ö => oe or ü => ue... but than system skip parameters as not existing.
Does someone know how to encode UMLAUTS? I also confused is this HTTP GET issue or Solr issue.
Thanks for any help.
via user2960820
No comments:
Post a Comment