vsb
vsb copied to clipboard
change 'Accepts' to specific type in request header
Short explanation: When using the AngularJS httpProvider, the default header for requests contains (see [1]):
Accept: application/json, text/plain, * / *
Note that there are no quality values. Some servers will not respect the order of the MIME types and will answer with any type of the highest quality.
This wouldn't be too bad if only the VSB (or rather jassa) could digest text/plain SPARQL results. Unfortunately, it cannot and throws an error. This commit fixes this behaviour.
- https://docs.angularjs.org/api/ng/service/$http
This is also an issue for me as the endpoint I'm trying to use doesn't recognise the generic type application/json. Arguable the accept type should be application/sparql-results+json, application/*+json, application/json.