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

Add NewRawRequest #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add NewRawRequest #170

wants to merge 1 commit into from

Conversation

milesbxf
Copy link
Contributor

@milesbxf milesbxf commented Feb 9, 2024

One common pitfall of using typhon.NewRequest for standard HTTP usage is that it's easy to try and use it like a regular http.NewRequest and pass in a raw body, expecting that to work - but then Typhon encodes the body as JSON. Now of course you could pass in an io.ReadCloser/io.Reader to avoid this, but you'd only know this from digging deep into the Typhon code, not from the docstrings!

One common pitfall of using typhon.NewRequest for standard HTTP usage is that it's easy to try and use it like a regular http.NewRequest and pass in a raw body, expecting that to work - but then Typhon encodes the body as JSON. Now of course you could pass in an io.ReadCloser/io.Reader to avoid this, but you'd only know this from digging deep into the Typhon code, not from the docstrings!
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

Successfully merging this pull request may close these issues.

None yet

1 participant