HydraConsole icon indicating copy to clipboard operation
HydraConsole copied to clipboard

Add HTTP headers to requests

Open rp-eric opened this issue 11 years ago • 5 comments

The feature proposed is to add to the user interface inputs which allow the addition of HTTP headers to requests. Such a capability is required for services which use the Authorization or other custom header for authentication.

rp-eric avatar Oct 24 '14 14:10 rp-eric

Yeah, good idea. Were you thinking of headers on a request level, i.e., add fields to the operation pop-over, or globally? PRs are welcome btw.

lanthaler avatar Oct 24 '14 15:10 lanthaler

I have started working on this feature on issue_13 branch of my fork. I was stopped because there is a significant problem with how expanding the JsonLD works.

Particularly, FileGetContentsLoader.php is used by the JsonLD library to automatically resolve URIs. I am not sure how custom HTTP headers would be added to such a thing. Perhaps adding custom headers to those requests will not be part of this feature.

For my particular case I have all files, including the contexts, behind authorization. The context files are not sensitive information however so with a bit of work I can just lift the authorization requirement on them.

rp-eric avatar Nov 06 '14 20:11 rp-eric

Sorry for the late reply. Indeed, this may cause problems in this case. It would, however, be quite simple to create a separate document loader which sends the right headers. This should actually be configurable in the JsonLD library but I haven’t found the time yet to implement that. If you have a couple of hours, you could look into that. It should be quite straightforward. It’s basically an implementation of this flag in the JSON-LD API spec: http://www.w3.org/TR/json-ld-api/#widl-JsonLdOptions-documentLoader

lanthaler avatar Nov 24 '14 21:11 lanthaler

Hi. Is there any progress status about this feature request ?

ogizanagi avatar Jun 02 '15 14:06 ogizanagi

No, unfortunately not. I couldn't find time to work on this.

lanthaler avatar Oct 08 '15 15:10 lanthaler