Set accept header for JavaScript client

This commit is contained in:
xhh 2016-01-20 10:29:09 +08:00
parent 40d83e7f52
commit 9c580a2447
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;