浏览代码

Fix missing contentType

Steven Silvester 7 年之前
父节点
当前提交
2eae711120
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      packages/services/src/contents/index.ts

+ 4 - 2
packages/services/src/contents/index.ts

@@ -1098,7 +1098,8 @@ class Drive implements Contents.IDrive {
       url: this._getUrl(localPath),
       method: 'PUT',
       cache: false,
-      data: JSON.stringify(options)
+      data: JSON.stringify(options),
+      contentType: 'application/json'
     };
     return ServerConnection.makeRequest(request, this.serverSettings).then(response => {
       // will return 200 for an existing file and 201 for a new file
@@ -1139,7 +1140,8 @@ class Drive implements Contents.IDrive {
     let request = {
       url: this._getUrl(toDir),
       method: 'POST',
-      data: JSON.stringify({ copy_from: fromFile })
+      data: JSON.stringify({ copy_from: fromFile }),
+      contentType: 'application/json'
     };
     return ServerConnection.makeRequest(request, this.serverSettings).then(response => {
       if (response.xhr.status !== 201) {