The error message is as follows:
{ " timestamp " : " 2018-12-06T01:37:11.184+0000 " , " status " : 415 , " error " : " Unsupported Media Type " , " message " : " Content type'text/plain;charset=UTF -8' not supported " , " path " : " /testgu/ycyzharry " }
problem causes:
Media Type, which is Internet Media Type, is also called MIME type. In the Http protocol message header, Content-Type is used to indicate the media type information in the specific request.
For example: Content-Type: text/html;charset:utf-8;
Common media format types are as follows:
text/ html: HTML format text / plain: plain text format text / xml: XML format image / gif: gif picture format image / jpeg: jpg picture format image /png: png picture format
Media format types beginning with application:
application/xhtml+ xml: XHTML format application / xml: XML data format application /atom+ xml: Atom XML aggregation format application / json: JSON data format application / pdf: pdf format application / msword: Word document format application /octet- stream: Binary Streaming data (such as common file downloads) application /x-www-form-urlencoded: The default encType in <form encType="”>, the form data is encoded in key/value format and sent to the server (the default submission data of the form Format)
Another common media format is used when uploading files:
multipart/form-data: When you need to upload files in the form, you need to use this format
The above is the content format of the content-type that we often use. The message information in this example indicates that the post request does not support the “text/plain” plain text format type.
Solution: Select the “application/json” JSON data format type to send a Post request, and successfully get the interface return value.
Read More:
- How to Solve Error: Missing type map configuration or unsupported mapping
- OpenCV(-206:Bad flag (parameter or structure field)) Unrecognized or unsupported array type [How to Solve]
- C++ Opencv+BaiDu OCR“error“: “unsupported_grant_type“, “error_description“: “The authorization grant
- Cobbler status error pxe-e61: Media test failure, check cable
- postman CSRF verification failed [How to Solve]
- maven Error: Element ‘dependency’ cannot have character [children], because the type’s content type is
- [Solved] Error while extracting response for type [] and content type []…
- When using postman assertion, the global variables set in the tests of the pit will take effect only after the interface is executed
- Libtorch Error: Expected object of type Variable but found type CUDALongType for argument #2 ‘index’
- [Solved] The method getContextPath() from the type HttpServletRequest refers to the missing type String
- [Solved] Postman Error: Error: NETERR: getaddrinfo ENOTFOUND localhost
- postman Error:There was an error connecting to XXXX
- ElasticSearch Create Index Error: mapper_parsing_exception Root mapping definition has unsupported parameters
- How to Solve Error: Unsupported field: HourOfDay
- [Solved] GBase 8a MPP Database Loading Error: Unsupported version
- [Solved] TypeError: super(type, obj): obj must be an instance or subtype of type
- [Go] Solve the empty interface interface{} cannot use (type []string) as type []interface {}
- [Solved] Android 5.1 code compilation error: Unsupported reloc 43
- How to Solve Error: Element ‘dependency’ cannot have character [children], because the type’s content type is element-
- [Solved] Postman Error: SSL Error: Self signed certificate Disable SSL Verification