| 程序包 | 说明 |
|---|---|
| com.jn.langx.util.net.http | |
| com.jn.langx.util.net.mime |
| 限定符和类型 | 方法和说明 |
|---|---|
MediaType |
HttpHeaders.getContentType()
Return the media type of the body, as specified
by the
Content-Type header. |
| 限定符和类型 | 方法和说明 |
|---|---|
List<MediaType> |
HttpHeaders.getAccept()
Return the list of acceptable media types,
as specified by the
Accept header. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
HttpHeaders.setContentType(MediaType mediaType)
Set the media type of the body,
as specified by the
Content-Type header. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
HttpHeaders.setAccept(List<MediaType> acceptableMediaTypes)
Set the list of acceptable media types,
as specified by the
Accept header. |
| 限定符和类型 | 字段和说明 |
|---|---|
static MediaType |
MediaType.ALL
Public constant media type that includes all media ranges (i.e. "*/*").
|
static MediaType |
MediaType.APPLICATION_ATOM_XML
Public constant media type for
application/atom+xml. |
static MediaType |
MediaType.APPLICATION_CBOR
Public constant media type for
application/cbor. |
static MediaType |
MediaType.APPLICATION_FORM_URLENCODED
Public constant media type for
application/x-www-form-urlencoded. |
static MediaType |
MediaType.APPLICATION_JSON
Public constant media type for
application/json. |
static MediaType |
MediaType.APPLICATION_JSON_UTF8
已过时。
as of 5.2 in favor of
APPLICATION_JSON
since major browsers like Chrome
now comply with the specification and interpret correctly UTF-8 special
characters without requiring a charset=UTF-8 parameter. |
static MediaType |
MediaType.APPLICATION_OCTET_STREAM
Public constant media type for
application/octet-stream. |
static MediaType |
MediaType.APPLICATION_PDF
Public constant media type for
application/pdf. |
static MediaType |
MediaType.APPLICATION_PROBLEM_JSON
Public constant media type for
application/problem+json. |
static MediaType |
MediaType.APPLICATION_PROBLEM_JSON_UTF8
已过时。
as of 5.2 in favor of
APPLICATION_PROBLEM_JSON
since major browsers like Chrome
now comply with the specification and interpret correctly UTF-8 special
characters without requiring a charset=UTF-8 parameter. |
static MediaType |
MediaType.APPLICATION_PROBLEM_XML
Public constant media type for
application/problem+xml. |
static MediaType |
MediaType.APPLICATION_RSS_XML
Public constant media type for
application/rss+xml. |
static MediaType |
MediaType.APPLICATION_STREAM_JSON
Public constant media type for
application/stream+json. |
static MediaType |
MediaType.APPLICATION_XHTML_XML
Public constant media type for
application/xhtml+xml. |
static MediaType |
MediaType.APPLICATION_XML
Public constant media type for
application/xml. |
static MediaType |
MediaType.IMAGE_GIF
Public constant media type for
image/gif. |
static MediaType |
MediaType.IMAGE_JPEG
Public constant media type for
image/jpeg. |
static MediaType |
MediaType.IMAGE_PNG
Public constant media type for
image/png. |
static MediaType |
MediaType.MULTIPART_FORM_DATA
Public constant media type for
multipart/form-data. |
static MediaType |
MediaType.MULTIPART_MIXED
Public constant media type for
multipart/mixed. |
static MediaType |
MediaType.MULTIPART_RELATED
Public constant media type for
multipart/related. |
static MediaType |
MediaType.TEXT_EVENT_STREAM
Public constant media type for
text/event-stream. |
static MediaType |
MediaType.TEXT_HTML
Public constant media type for
text/html. |
static MediaType |
MediaType.TEXT_MARKDOWN
Public constant media type for
text/markdown. |
static MediaType |
MediaType.TEXT_PLAIN
Public constant media type for
text/plain. |
static MediaType |
MediaType.TEXT_XML
Public constant media type for
text/xml. |
| 限定符和类型 | 字段和说明 |
|---|---|
static Comparator<MediaType> |
MediaType.QUALITY_VALUE_COMPARATOR
Comparator used by
sortByQualityValue(List). |
static Comparator<MediaType> |
MediaType.SPECIFICITY_COMPARATOR
Comparator used by
sortBySpecificity(List). |
| 限定符和类型 | 方法和说明 |
|---|---|
static MediaType |
MediaType.asMediaType(MimeType mimeType)
Re-create the given mime type as a media type.
|
MediaType |
MediaType.copyQualityValue(MediaType mediaType)
Return a replica of this instance with the quality value of the given
MediaType. |
static MediaType |
MediaType.parseMediaType(String mediaType)
Parse the given String into a single
MediaType. |
MediaType |
MediaType.removeQualityValue()
Return a replica of this instance with its quality value removed.
|
static MediaType |
MediaType.valueOf(String value)
Parse the given String value into a
MediaType object,
with this method name following the 'valueOf' naming convention |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<MediaType> |
MediaType.asMediaTypes(List<MimeType> mimeTypes)
Re-create the given mime types as media types.
|
static List<MediaType> |
MediaType.parseMediaTypes(List<String> mediaTypes)
Parse the given list of (potentially) comma-separated strings into a
list of
MediaType objects. |
static List<MediaType> |
MediaType.parseMediaTypes(String mediaTypes)
Parse the comma-separated string into a list of
MediaType objects. |
| 限定符和类型 | 方法和说明 |
|---|---|
MediaType |
MediaType.copyQualityValue(MediaType mediaType)
Return a replica of this instance with the quality value of the given
MediaType. |
boolean |
MediaType.includes(MediaType other)
Indicate whether this
MediaType includes the given media type. |
boolean |
MediaType.isCompatibleWith(MediaType other)
Indicate whether this
MediaType is compatible with the given media type. |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
MediaType.sortByQualityValue(List<MediaType> mediaTypes)
Sorts the given list of
MediaType objects by quality value. |
static void |
MediaType.sortBySpecificity(List<MediaType> mediaTypes)
Sorts the given list of
MediaType objects by specificity. |
static void |
MediaType.sortBySpecificityAndQuality(List<MediaType> mediaTypes)
Sorts the given list of
MediaType objects by specificity as the
primary criteria and quality value the secondary. |
static String |
MediaType.toString(Collection<MediaType> mediaTypes)
Return a string representation of the given list of
MediaType objects. |
| 构造器和说明 |
|---|
MediaType(MediaType other,
Charset charset)
Copy-constructor that copies the type, subtype and parameters of the given
MediaType, and allows to set the specified character set. |
MediaType(MediaType other,
Map<String,String> parameters)
Copy-constructor that copies the type and subtype of the given
MediaType,
and allows for different parameters. |
Copyright © 2022. All rights reserved.