bitfocus / companion-module-generic-http

Generic HTTP module
MIT License
9 stars 19 forks source link

Allow non-JSON POST body #9

Closed aaronpk closed 2 years ago

aaronpk commented 3 years ago

The module is called "generic http" but it seems to require a JSON POST body. I'd like to be able to set the POST body to an arbitrary string.

Prosperelucel commented 3 years ago

+1

I already did it on my version : Remove 'JSON.parse' in line 156 and now you can send what you want, the script will not check for a correct JSON syntax (I guess)

body = JSON.parse(action.options.body); to body = action.options.body;

I'm not an expert and you have to compile the companion app with this modification, it can be painful ahah

josephdadams commented 2 years ago

I added support for this with #18