Set accept header for JavaScript client

This commit is contained in:
xhh 2016-01-20 10:29:09 +08:00 committed by Maelig Nantel
parent 93cadcd755
commit ecbc4a147c
2 changed files with 10 additions and 0 deletions

View File

@ -130,6 +130,11 @@
request.send(bodyParam);
}
var accept = this.jsonPreferredMime(accepts);
if (accept) {
request.accept(accept);
}
request.end(function(error, response) {
if (callback) {
var data = response && response.body;

View File

@ -130,6 +130,11 @@
request.send(bodyParam);
}
var accept = this.jsonPreferredMime(accepts);
if (accept) {
request.accept(accept);
}
request.end(function(error, response) {
if (callback) {
var data = response && response.body;