force content-type in FreeNAS http requests

This commit is contained in:
Travis Glenn Hansen 2019-12-02 17:09:12 -07:00
parent a1c045ee7b
commit 0e3f97877b
1 changed files with 12 additions and 8 deletions

View File

@ -53,8 +53,9 @@ class Client {
method: "GET",
url: this.getBaseURL() + endpoint,
headers: {
Accept: "*/*",
"User-Agent": USER_AGENT
Accept: "application/json",
"User-Agent": USER_AGENT,
"Content-Type": "application/json"
},
json: true,
qs: data,
@ -84,8 +85,9 @@ class Client {
method: "POST",
url: this.getBaseURL() + endpoint,
headers: {
Accept: "*/*",
"User-Agent": USER_AGENT
Accept: "application/json",
"User-Agent": USER_AGENT,
"Content-Type": "application/json"
},
json: true,
body: data,
@ -115,8 +117,9 @@ class Client {
method: "PUT",
url: this.getBaseURL() + endpoint,
headers: {
Accept: "*/*",
"User-Agent": USER_AGENT
Accept: "application/json",
"User-Agent": USER_AGENT,
"Content-Type": "application/json"
},
json: true,
body: data,
@ -146,8 +149,9 @@ class Client {
method: "DELETE",
url: this.getBaseURL() + endpoint,
headers: {
Accept: "*/*",
"User-Agent": USER_AGENT
Accept: "application/json",
"User-Agent": USER_AGENT,
"Content-Type": "application/json"
},
json: true,
body: data,