New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the content type 'application/sparql-update' when preparing a SPARQL update request #1022
Add the content type 'application/sparql-update' when preparing a SPARQL update request #1022
Conversation
…header before sending the update query to a the SPARQL update endpoint
Going by https://w3c.github.io/rdf-tests/sparql11/data-sparql11/protocol/index.html, might be worth updating |
@effigies I've done as you suggest adding to @white-gecko: since I've added to this, please could you review? |
@nicholascar Tnx for your updates! One thing: Given the w3C query spec the Content-Type header only needs to be set when request method is POST... |
@white-gecko can you please review and likely merge? Just want to make sure I, as a contributor to the PR, don't merge |
Could we add a test for this? |
Now I have contributed as well. But I think the test is the code-ification of my review result so I did approve it and will merge it. |
PR for issue #1021 @nicholascar
When sending a POST request to the SPARQL update endpoint, the endpoint wants to be told which type of content it'll receive in request.
Since SPARQLConnector encodes the data with UTF-8 the request library can not deduce the correct Content-Type itself. By adding it explicitly to the headers parameter, the requests library will send to request the SPARQL update endpoint understands. At least when the sparql endpoint is a GraphDB instance...
Note: Didn't find a SPARQLConnector unit test where the addition of the content type header could be validated. Skipped making one... (?)
Closes #1021