serverless-apigw-binary
serverless-apigw-binary copied to clipboard
sls invoke returns gzip(base64(json))
for now i'm using the below script to invoke + decode the response data:
invoke script:
#!/bin/sh
RESP=$(sls invoke $@)
STATUS=$(echo $RESP | jq .statusCode --raw-output)
if [ "$STATUS" == "200" ]; then
echo $RESP | jq .body --raw-output | base64 --decode | gunzip | jq
else
echo $RESP | jq
fi
then i run: ./invoke --path ./path/to/event.json -f function_name
would you want to handle the decoding internally, maybe by looking for a custom flag to invoke, e.g. --compressed (a la curl)?
Sounds interesting. Would you like to participate in this enhancement?
@maciejtreder i would! However, i'm afraid i won't be able to in the short term, I'm already overcommitted, so if you or someone else wants to implement this, don't wait for me. Also, thanks for the plugin :)
@mvayngrib Same with me (regarding backlog of things to do). So, no worries. Start when you will be able to and there won't be such fix yet :)
Thanks in advance!