Skip to content

Commit

Permalink
Allow post requests to the documents REST API
Browse files Browse the repository at this point in the history
Closes oracle#17
  • Loading branch information
tcaruth committed Feb 9, 2022
1 parent 46740c3 commit 2bceb2d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sites/test/server/documentsRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ router.post('/*', (req, res) => {
postData.form = body;
}

if (typeof body == 'string' && typeof JSON.parse(body) == 'object') {
postData.json = true
postData.body = JSON.parse(body)
}

console.log(' postData=' + JSON.stringify(postData));
request(postData).on('response', function (response) {
// fix headers for cross-domain and capitalization issues
Expand Down

0 comments on commit 2bceb2d

Please sign in to comment.