mirror of
https://github.com/gosticks/web.git
synced 2026-10-07 07:07:07 +00:00
Send Content-Type along with the POST request
This commit is contained in:
+5
-1
@@ -94,7 +94,11 @@ export const api = {
|
||||
return fetch(this.urlFor(url)).then(data => data.json());
|
||||
},
|
||||
post(url, data) {
|
||||
return fetch(this.urlFor(url), { method: "POST", body: JSON.stringify(data) }).then(data => data.json());
|
||||
return fetch(this.urlFor(url), {
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
headers: new Headers({ "Content-Type": "application/json" })
|
||||
}).then(data => data.json());
|
||||
},
|
||||
delete(url) {
|
||||
return fetch(this.urlFor(url), { method: "DELETE" }).then(data => data.json());
|
||||
|
||||
Reference in New Issue
Block a user