Skip to content

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

@MattCCC

Description

@MattCCC

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions