KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Say I got: app.get('/json', function(req, res) { res.set({ 'content-type': 'application/json' }).send('{"status": "0"}'); }); I'm trying to send the response as UTF-8 with the following with no success: app.get('/json', function(req, res) { // From Node.js Official Doc // http://nodejs.org/api/http.html#http_http_request_options_callback res.setEncoding('utf8'); res.set({ 'content-type': 'application/json' }).send('{"status": "0"}'); }); What is the correct way to set character encoding in Express?
Tags (comma-separated)
Save Edits
Cancel