RDFLib / prez-ui

BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

Allows the use of the Prez /sparql endpoint using POST method #169

Open ashleysommer opened 4 months ago

ashleysommer commented 4 months ago

Allows the use of the Prez /sparql passthrough endpoint using the POST method rather than GET.

This supports larger SPARQL queries on Prez APIs that do not support long query args in GET requests.

Fixes an issue on Azure APIM where it cannot accept an API route where the query param (/sparql?query=...) is longer than 2048 characters. It allows unlimited payload on POST.

I don't think this implementation is the cleanest way of doing it (all users of useSparqlRequest() get both a sparqlGetRequest fn and a sparqlPostRequest fn, and can use whichever they prefer). But it is the method I used to get around the issue.

This requires corresponding PR to be merged in backend Prez-api: https://github.com/RDFLib/prez/pull/239