Merge pull request #633 from dozed/fix/set-sparql-body

Fix: Set body on SPARQL request
This commit is contained in:
Anoop M D 2023-10-17 15:50:50 +05:30 committed by GitHub
commit b31d7044a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,6 +88,13 @@ const prepareRequest = (request, collectionRoot) => {
axiosRequest.data = request.body.xml; axiosRequest.data = request.body.xml;
} }
if (request.body.mode === 'sparql') {
if (!contentTypeDefined) {
axiosRequest.headers['content-type'] = 'application/sparql-query';
}
axiosRequest.data = request.body.sparql;
}
if (request.body.mode === 'formUrlEncoded') { if (request.body.mode === 'formUrlEncoded') {
axiosRequest.headers['content-type'] = 'application/x-www-form-urlencoded'; axiosRequest.headers['content-type'] = 'application/x-www-form-urlencoded';
const params = {}; const params = {};