Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@seanmil
Copy link
Contributor

@seanmil seanmil commented Mar 21, 2025

Allow the user to configure the client to use a Content-Type of application/json for all requests with a body unless the request explicitly provides its own Content-Type header.

Using application/json provides a broader range of compatibility with the GitLab API, especially for calls where the body expects more complex data structures.

This defaults to false for backwards compatibility.

Allow the user to configure the client to use
a Content-Type of application/json for all requests
with a body unless the request explicitly provides
its own Content-Type header.

Using application/json provides a broader range
of compatibility with the GitLab API, especially
for calls where the body expects more complex
data structures.

This defaults to false for backwards compatibility.
@seanmil
Copy link
Contributor Author

seanmil commented Mar 21, 2025

Note that I believe always using application/json by default would be a good change for the next non-backwards-compatible release. I don't believe any part of the GitLab API cannot accept JSON bodies (excepting file uploads requiring multipart form-data, such as https://docs.gitlab.com/api/secure_files/#create-secure-file)

@NARKOZ NARKOZ merged commit c84f3d8 into NARKOZ:master Jun 18, 2025
4 checks passed
@NARKOZ
Copy link
Owner

NARKOZ commented Jun 18, 2025

Thank you!

@NARKOZ
Copy link
Owner

NARKOZ commented Jun 28, 2025

Released in version 6.0.0 https://github.com/NARKOZ/gitlab/releases/tag/v6.0.0

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.

2 participants