"application/json" always gets added if no content-type header was set

Created on 8 December 2023, 10 months ago
Updated 28 June 2024, 3 months ago

Problem/Motivation

The "Content-Type" header always gets set to application/json, this tends to break `multipart/form-data` requests because a `boundary` needs to be added to this header.
Guzzle normally handles this automatically when it detects a `multipart` option in the request.

Steps to reproduce

Create a new request with `RequestOptions::MULTIPART` parameter and try to send it.

Proposed resolution

For now, we can add a check so this header isn't set automatically in this module when a multipart request is detected.
But generally, this gives us food for thought: should the `Content-Type` header always be set to "application/json" if the user did not provide one? I feel like this is a user error and should be treated as such, rather than trying to fix it automatically.

Remaining tasks

Review MR.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇪Belgium RandalV

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024