forked from loafle/openapi-generator-original
[Java][okhttp-gson] Support text/plain body (#10885)
* support serialize RequestBody with contentType text/plain * add Serialize test * update test comment
This commit is contained in:
@@ -972,6 +972,8 @@ public class ApiClient {
|
||||
} else if (obj instanceof File) {
|
||||
// File body parameter support.
|
||||
return RequestBody.create((File) obj, MediaType.parse(contentType));
|
||||
} else if ("text/plain".equals(contentType) && obj instanceof String) {
|
||||
return RequestBody.create((String) obj, MediaType.parse(contentType));
|
||||
} else if (isJsonMime(contentType)) {
|
||||
String content;
|
||||
if (obj != null) {
|
||||
|
||||
Reference in New Issue
Block a user