Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curlify do not support binary files in post body #30

Open
fenchu opened this issue Sep 6, 2022 · 0 comments
Open

curlify do not support binary files in post body #30

fenchu opened this issue Sep 6, 2022 · 0 comments

Comments

@fenchu
Copy link

fenchu commented Sep 6, 2022

I use curlify in requests hook so I can get any requests as a curl command. works excellent except for when posts have binary data in body:

curlify==2.2.1

mycurl=curlify.to_curl(response.request, compressed=True)
  File "c:\dist\work\smartcard-fullstack-test\tools\trace.py", line 37, in print_roundtrip
    mycurl=curlify.to_curl(response.request, compressed=True),
  File "C:\dist\venvs\smartcard-fullstack-test\lib\site-packages\curlify.py", line 28, in to_curl
    body = body.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf5 in position 117: invalid start byte

requests>=2.27.1 manage to print(f"{response.requests.body}") all fine even if it holds long binary files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant