-
Notifications
You must be signed in to change notification settings - Fork 123
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
allow for manual setting of Accept header or headers in general #52
Comments
i didn't want to suggest to encourage bad behavior, but i'm suggesting to allow for easier customization so that developers can use the lib in the real world even if things go slightly wrong. If you read the thread on stackoverflow, you saw that the endpoint actually follows protocol, but that it doesn't seem to understand the longer than necessary Accept header we send for compatibility reasons: Why shouldn't we allow a developer to just send one of these alternatives / in general manually set the headers? At the moment the workaround for this really minor flaw of the endpoint is relatively complicated just cause |
I need to access an endpoint that requires a custom header attribute to pass an API token. Am I correct in thinking that I can't do this with SPARQLwrapper as it currently stands? |
@psychemedia, do you need header or parameter? Because for parameter But headers we're not yet there. |
Header.... I wondered about something hacky like adding a parameter into class initialiser:
and then fudging the request code:
|
@wikier @iherman @indeyets What do you think to add the functionality explained in #52 (comment) ? |
SGTM |
See pull request #103 with an initial approach |
as can be seen in http://stackoverflow.com/a/30306013/1423333 there are endpoints out there which don't understand the
",".join(_SPARQL_JSON)
https://github.com/RDFLib/sparqlwrapper/blob/master/SPARQLWrapper/Wrapper.py#L451 Accept header, but only want "one" mime-type :(in https://github.com/RDFLib/sparqlwrapper/blob/master/SPARQLWrapper/Wrapper.py#L506 we unconditionally add the Accept header.
I think it would be much better if one could manually set headers somehow and the
_createRequest()
method wouldn't override them if they're there already.Could be done in one go when switching to the Requests lib (see #51)?
The text was updated successfully, but these errors were encountered: