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

[Bug]: HTTPie Desktop sets default Content-Type header on operations #165

Open
1 task done
echarpibm opened this issue Apr 22, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@echarpibm
Copy link

echarpibm commented Apr 22, 2024

What happened?

HTTPie Desktop sets Content-Type header application/json on operations.

Some systems receiving the request will not allow an empty body on Content-Type set to application/json

For example Fastify will give an error: Body cannot be empty when content-type is set to 'application/json'

The workaround is to force a Content-Type header with text/plain as a value, but this should not be necessary.

Steps to reproduce?

1. Create a simple DELETE requests with no headers
2. Notice that the Desktop App set a header for `Content-Type`

Similar behaviour for a POST operation.

What did you expect to happen?

No header should automatically be set for any requests.

Platform

Windows

HTTPie Desktop version

2024.1.2

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@echarpibm echarpibm added the bug Something isn't working label Apr 22, 2024
@echarpibm echarpibm changed the title [Bug]: HTTPie Desktop sets Content-Type header on DELETE [Bug]: HTTPie Desktop sets default Content-Type header on operations Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant