Merge pull request #516 from dozed/feature/sparql-body

Add support for SPARQL bodies
This commit is contained in:
Anoop M D
2023-10-11 03:07:57 +05:30
committed by GitHub
12 changed files with 60 additions and 5 deletions

View File

@@ -82,6 +82,15 @@ const RequestBodyMode = ({ item, collection }) => {
>
TEXT
</div>
<div
className="dropdown-item"
onClick={() => {
dropdownTippyRef.current.hide();
onModeChange('sparql');
}}
>
SPARQL
</div>
<div className="label-item font-medium">Other</div>
<div
className="dropdown-item"

View File

@@ -28,17 +28,19 @@ const RequestBody = ({ item, collection }) => {
const onRun = () => dispatch(sendRequest(item, collection.uid));
const onSave = () => dispatch(saveRequest(item.uid, collection.uid));
if (['json', 'xml', 'text'].includes(bodyMode)) {
if (['json', 'xml', 'text', 'sparql'].includes(bodyMode)) {
let codeMirrorMode = {
json: 'application/ld+json',
text: 'application/text',
xml: 'application/xml'
xml: 'application/xml',
sparql: 'application/sparql-query'
};
let bodyContent = {
json: body.json,
text: body.text,
xml: body.xml
xml: body.xml,
sparql: body.sparql
};
return (