oblac / jodd

Jodd! Lightweight. Java. Zero dependencies. Use what you like.

Home Page:https://jodd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't overwrite character encoding when setting bodyText()

igr opened this issue · comments

.bodyText()

overides

contentTypeJson

Are you referring to

public T bodyText(final String body) {
?

Thats on purpose, isnt it? It explicitly sets the default mime type, right? In case thats not desired one has the other two bodyTexts, right?

Am I missing something? :)

The use case is the following:

HttpRequest
    .contentTypeJson()
    .bodyText("json");

This means that bodyText will override the content type and I need to re-order the methods.

I would like to preserve the content type if set, when assuming defaults.

@neroux

I think I got you :), you only want to use defaults when there is nothing specified yet, right?

Correct :)