H
H
HoHsi2015-12-15 12:52:48
Character encoding
HoHsi, 2015-12-15 12:52:48

How to send post request with win1251 encoding using Node.js?

Good afternoon!
Tell me how to send a Post request to a site with win1251 encoding?
Get data is out, but sending it with a POST request is not.
I use request and iconv-lite

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2015-12-16
@maxloyko

Try like this

request({
    headers: {
      //тут заголовки 
      'Content-Type': 'Content-type: text/html; charset=win1251'
    },
    uri: 'http:/myUrl',
    body: formData,
    method: 'POST'
  }, function (err, res, body) {
    //it works!
  });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question