danwrong / restler

REST client library for node.js
MIT License
1.99k stars 391 forks source link

New option: forceResponseCharset #185

Open miguelsanchezvigo opened 9 years ago

miguelsanchezvigo commented 9 years ago

forceResponseCharset

This option allows user to force the charset of the response. This is useful when no charset is specified in response.

Example usage

rest.post('http://twaud.io/api/v1/users/danwrong.json', {
  forceResponseCharset: 'iso-8859-15'
}).on('complete', function(data) {
  console.log(data[0].message); // auto convert to object
});
easternbloc commented 9 years ago

Hi Miguel thanks for contributing.

I'm gonna need some tests before this can go any further.

Thanks.