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

[Improvement] Remove content type from DELETE and PUT methods by default #75

Closed
MattCCC opened this issue Oct 9, 2024 · 3 comments · Fixed by #79
Closed

[Improvement] Remove content type from DELETE and PUT methods by default #75

MattCCC opened this issue Oct 9, 2024 · 3 comments · Fixed by #79
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@MattCCC
Copy link
Owner

MattCCC commented Oct 9, 2024

In HTTP requests, DELETE and PUT methods often do not require a Content-Type header, especially when no request body is being sent. Currently, the fetchff plugin automatically adds the Content-Type header for all request methods, including DELETE and PUT, even when it's unnecessary.

This issue aims to enhance the library by:

  1. Removing the Content-Type header from DELETE and PUT requests by default, unless a request body is explicitly provided by the user.
  2. Ensuring that this behavior is consistent across all instances of fetchff.
  3. Providing the ability for users to override the behavior by manually setting a Content-Type if needed.

Motivation:

  • Simplifies the HTTP requests where no content is required, making them cleaner and more aligned with HTTP specifications.
  • Reduces potential confusion for users who may expect no Content-Type for these methods.
  • Ensures better interoperability with certain APIs that may reject DELETE or PUT requests with an unnecessary Content-Type.
@MattCCC MattCCC added good first issue Good for newcomers enhancement New feature or request labels Oct 9, 2024
@saewoohan
Copy link

Hi @MattCCC , please assign me to this issue

@MattCCC
Copy link
Owner Author

MattCCC commented Oct 11, 2024

Hi @MattCCC , please assign me to this issue

Done 😄

@red-game-dev
Copy link
Collaborator

I'll take over and handle this today 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants