Skip to content
This repository was archived by the owner on Feb 28, 2022. It is now read-only.

Commit 9a51522

Browse files
kewangjmfrancois
authored andcommitted
fix(api): incorrect content-type on HTTP PUT (#3)
1 parent f4eff38 commit 9a51522

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/api/api.service.js

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ class OSMAPI {
102102
_config.method = 'PUT';
103103
_config.path = method;
104104
_config.data = this.osmx2js.js2xml(content);
105+
_config.options = {};
106+
_config.options.header = {"Content-Type": "text/xml"};
105107
return this.xhr(_config);
106108
}
107109
/**

src/oauth/oauth.service.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class OAuthAdapter{
5151
var deferred = this.$q.defer();
5252
options.path = '/api' + options.path;
5353
if (options.data) {
54-
options.body = options.data;
55-
options.data = undefined;
54+
options.content = options.data;
55+
delete options.data;
5656
}
5757
this.auth.xhr(options, function (err, data) {
5858
if (err) {

0 commit comments

Comments
 (0)