Closed pink-red closed 1 year ago
Is there a way to configure an endpoint to return binary data, for example, in base64?
You could try the unix pipe |
your command to base64
. For example, echo "Hello" | base64
. Might need to put your command in a custom script (.sh
/.py
/etc) to use pipes though (refer to this example).
You may be able to use a decorator to achieve this too (example).
You could try the unix pipe
|
your command tobase64
.
Thank you for your suggestion. I ended up creating this wrapper script:
#!/bin/sh
<the-command> "$@" | base64 --wrap 0
and it's called like this:
shell2http.register_command(endpoint="some-enpoint", command_name="./script.sh")
Works like a charm!
First of all, thank you for this project! It was very easy to set up a couple of endpoints.
Now, I am trying to create another endpoint for a command which returns binary output and I'm getting an error:
Is there a way to configure an endpoint to return binary data, for example, in base64?