lanthaler / HydraConsole

HydraConsole is an implementation of a generic API client for Hydra-based Web APIs in the form of a single-page application.
http://www.markus-lanthaler.com/hydra/
MIT License
103 stars 17 forks source link

Add HTTP headers to requests #13

Open rp-eric opened 10 years ago

rp-eric commented 10 years ago

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.

lanthaler commented 10 years ago

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.

rp-eric commented 10 years ago

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.

lanthaler commented 9 years ago

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

ogizanagi commented 9 years ago

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

lanthaler commented 9 years ago

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