okigan / awscurl

curl-like access to AWS resources with AWS Signature Version 4 request signing.
MIT License
769 stars 94 forks source link

output option errors with text response #210

Closed jackie-linz closed 2 months ago

jackie-linz commented 2 months ago
$ python3 -m awscurl --service lambda https://<my-function-url>.lambda-url.ap-southeast-2.on.aws/
{"data":"Hello from Lambda!"}

$ python3 -m awscurl --service lambda https://<my-function-url>.lambda-url.ap-southeast-2.on.aws/ -o out.json
{"data":"Hello from Lambda!"}
Traceback (most recent call last):
  File "/home/jweng/.local/bin/awscurl", line 8, in <module>
    sys.exit(main())
  File "/home/jweng/.local/lib/python3.10/site-packages/awscurl/awscurl.py", line 573, in main
    inner_main(sys.argv[1:])
  File "/home/jweng/.local/lib/python3.10/site-packages/awscurl/awscurl.py", line 565, in inner_main
    f.write(response.content)
TypeError: write() argument must be str, not bytes