diff --git a/sourcePane.js b/sourcePane.js index 4ea25c2..0818d8b 100644 --- a/sourcePane.js +++ b/sourcePane.js @@ -51,10 +51,17 @@ module.exports = { throw new Error(msg) } + function contentForNew (contentType) { + let content = '\n' + if (contentType.includes('json')) content = '{}\n' + else if (contentType.includes('rdf+xml')) content = '\n\n' + return content + } + return new Promise(function (resolve, reject) { kb.fetcher .webOperation('PUT', newInstance.uri, { - data: contentType.includes('json') ? '{}\n' : '\n', + data: contentForNew(contentType), contentType: contentType }) .then(