public enum BodyType extends Enum<BodyType>
| Enum Constant and Description |
|---|
BINARY
Binary stream format: application/octet-stream
The request body will be transmitted as binary stream (e.g., file upload)
|
FORM
Form-urlencoded format: application/x-www-form-urlencoded; charset=utf-8
The request object will be serialized to form key-value pairs
|
JSON
JSON format: application/json; charset=utf-8
The request object will be serialized to JSON string
|
NONE
No request body
|
XML
XML format: application/xml; charset=utf-8
The request object will be serialized to XML
|
| Modifier and Type | Method and Description |
|---|---|
String |
getContentType()
Get the Content-Type header value for this body type
|
boolean |
hasContentType()
Check if this body type has a content type
|
static BodyType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BodyType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BodyType JSON
public static final BodyType FORM
public static final BodyType BINARY
public static final BodyType XML
public static final BodyType NONE
public static BodyType[] values()
for (BodyType c : BodyType.values()) System.out.println(c);
public static BodyType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getContentType()
public boolean hasContentType()
Copyright © 2026. All rights reserved.