Closed mielvds closed 1 year ago
This is not supported yet indeed. But should be easy to add.
My recommendation would be to add an optional customHeaders?: Headers
argument to ISparqlEndpointFetcherArgs
, which can then be stored as a field in SparqlEndpointFetcher
when passed to the constructor.
If that field is defined, it could indeed be merged with the headers here: https://github.com/rubensworks/fetch-sparql-endpoint.js/blob/master/lib/SparqlEndpointFetcher.ts#L180
We may also want to include those headers here: https://github.com/rubensworks/fetch-sparql-endpoint.js/blob/master/lib/SparqlEndpointFetcher.ts#L154-L156
Is there a way to provide custom HTTP headers (eg. for authentication)? For instance, by merging an object in https://github.com/rubensworks/fetch-sparql-endpoint.js/blob/master/lib/SparqlEndpointFetcher.ts#L180. @rubensworks If you can provide some guidance on the how, I can try a PR.