Answer the question
In order to leave comments, you need to log in
How to send cyrillic in request.js request?
Hello!
Node.js question + request module.
Why, when sending the Cyrillic alphabet in a get request, the server receives not the word hello (in this case), but a certain string @825B. Latin is ok. What is the matter and how to solve this problem?
const request = require('request')
request( ' https://site/hello ' function (error, response, body) { console.log(body) })
Answer the question
In order to leave comments, you need to log in
You can try to const
write the canonical one instead. var
Or like this:
var str = encodeURIComponent('https://site/привет');
console.log(str); // https%3A%2F%2Fsite%2F%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question