basilapi / basil

Building Apis SImpLy from sparql endpoints
http://basil.kmi.open.ac.uk
24 stars 5 forks source link

question: can basil pass HTTP headers to a sparql endpoint? #128

Closed justin2004 closed 1 year ago

justin2004 commented 1 year ago

i gave basil a try today but i needed to pass HTTP headers to the sparql endpoint. i also needed basil to do a POST instead of a GET.

can basil do those things?

enridaga commented 1 year ago

The execution is delegated to Jena, see https://github.com/basilapi/basil/blob/5ab29392551e9789bc7a5ed51301189743316626/core/src/main/java/io/github/basilapi/basil/invoke/DirectExecutor.java#L39

so in theory, no, we cannot customise it yet. If it's authentication you're after, this can be done via the /basil/<id>/auth resource, see https://github.com/basilapi/basil/blob/5ab29392551e9789bc7a5ed51301189743316626/rest/src/main/java/io/github/basilapi/basil/rest/core/CredentialsResource.java#L56

Unfortunately, this feature is not documented yet. To add credentials use the PUT method, passing a plain text file with username and password, line separated. Use GET and DELETE to either view or remove.

justin2004 commented 1 year ago

i did indeed need auth and it worked. thanks @enridaga !