bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Stream Deck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.6k stars 503 forks source link

Enhancements to Generic HTTP module #1084

Closed empyfree closed 2 years ago

empyfree commented 4 years ago

Describe the feature Update the Generic HTTP module to include some useful options and functionality.

As per Facebook conversation with @josephdadams the current HTTP module is pre configured to send “Application/JSON” type headers.

https://www.facebook.com/groups/companion/permalink/2558279757723692/

It would be nice to have options here to change the format of the request.

I do not know enough about the varying types of HTTP requests to suggest what the options should be!?

Is this platform dependent (windows, mac, ..)? I do not believe so.

Usecases Simple and direct control of IFTTT webhooks service. My use case was to remotely turn on and off a fan as part of a sensory projection show (for my daughter!).

josephdadams commented 4 years ago

Leaving this here instead of transferring to the generic HTTP module because we will need to modify the core REST library if we want to support changing the header type. It is application/json for GET, POST, and PUT by default. I recommend we implement a drop-down and at least include:

I don't see reason to add them all.

noctividus commented 4 years ago

I support this. It would allow us to control OpenHAB from companion.

jimmystuart commented 4 years ago

I would support this as well. I'm currently replicating the ProPresenter Scoreboard web remote in companion and while I'd love to create it as a module and submit it for everyone, it needs to send form data in a POST and not JSON (again mimicking the web remote because the API doesn't contain the same functions). Right now I'm limited to putting curl commands in the run shell path button action to make them talk.

magicofit commented 2 years ago

Yes, it would be really nice, if we have at least two options in connection-settings for generic http:

Base URL: http://openhab.local/rest/items/ Content-Type: text/plain

Default-Value for this Content-Type field could stay "application/json" but with a possibility to change it. This could be a minimal solution to support openHAB.

josephdadams commented 2 years ago

These PR's should take care of it:

https://github.com/bitfocus/companion-module-generic-http/pull/18

and #1790

josephdadams commented 2 years ago

I implemented this. With help from @estilles :)

magicofit commented 2 years ago

Thanks @josephdadams this few lines transformed my Streamdeck to a complete smarthome interface. :)