public interface ContentType extends Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
static ContentType |
ALL |
static ContentType |
APPLICATION_ATOM_XML |
static ContentType |
APPLICATION_FORM_URLENCODED |
static ContentType |
APPLICATION_JSON |
static ContentType |
APPLICATION_OCTET_STREAM |
static ContentType |
APPLICATION_SVG_XML |
static ContentType |
APPLICATION_XHTML_XML |
static ContentType |
APPLICATION_XML |
static ContentType |
IMAGE_GIF |
static ContentType |
IMAGE_JPEG |
static ContentType |
IMAGE_PNG |
static ContentType |
IMAGE_TIFF |
static ContentType |
IMAGE_WEBP |
static ContentType |
MULTIPART_FORM_DATA |
static ContentType |
TEXT_EVENT_STREAM |
static ContentType |
TEXT_HTML |
static ContentType |
TEXT_PLAIN |
static ContentType |
TEXT_XML |
| 限定符和类型 | 方法和说明 |
|---|---|
static ContentType |
create(String mediaType) |
static ContentType |
create(String mediaType,
Charset charset) |
static ContentType |
create(String mediaType,
Charset charset,
Collection<? extends NameValuePair> parameters) |
static ContentType |
create(String mediaType,
Collection<? extends NameValuePair> parameters) |
static ContentType |
create(String mediaType,
String charset) |
static ContentType |
create(String mediaType,
String charset,
Collection<? extends NameValuePair> parameters) |
String |
getCharset() |
String |
getMediaType() |
String |
getParameter(String name) |
Collection<NameValuePair> |
getParameters() |
default Header |
toHeader() |
default ContentType |
withCharset(Charset charset) |
ContentType |
withCharset(String charset) |
ContentType |
withParameter(NameValuePair... params) |
default ContentType |
withParameter(String name,
String value) |
static final ContentType APPLICATION_ATOM_XML
static final ContentType APPLICATION_FORM_URLENCODED
static final ContentType APPLICATION_JSON
static final ContentType APPLICATION_OCTET_STREAM
static final ContentType APPLICATION_SVG_XML
static final ContentType APPLICATION_XHTML_XML
static final ContentType APPLICATION_XML
static final ContentType IMAGE_GIF
static final ContentType IMAGE_JPEG
static final ContentType IMAGE_PNG
static final ContentType IMAGE_TIFF
static final ContentType IMAGE_WEBP
static final ContentType MULTIPART_FORM_DATA
static final ContentType TEXT_EVENT_STREAM
static final ContentType TEXT_HTML
static final ContentType TEXT_PLAIN
static final ContentType TEXT_XML
static final ContentType ALL
@Nonnull String getMediaType()
String getCharset()
Collection<NameValuePair> getParameters()
@Nonnull default ContentType withCharset(Charset charset)
@Nonnull ContentType withCharset(String charset)
@Nonnull default ContentType withParameter(@Nonnull String name, @Nonnull String value)
@Nonnull ContentType withParameter(@Nonnull NameValuePair... params)
@Nonnull default Header toHeader()
@Nonnull static ContentType create(@Nonnull String mediaType)
@Nonnull static ContentType create(@Nonnull String mediaType, Charset charset)
@Nonnull static ContentType create(@Nonnull String mediaType, Charset charset, Collection<? extends NameValuePair> parameters)
@Nonnull static ContentType create(@Nonnull String mediaType, Collection<? extends NameValuePair> parameters)
@Nonnull static ContentType create(@Nonnull String mediaType, String charset)
@Nonnull static ContentType create(@Nonnull String mediaType, String charset, Collection<? extends NameValuePair> parameters)
Copyright © 2024. All rights reserved.