Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 350 Vote(s) - 3.54 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Content type 'application/json;charset=UTF-8' not supported" in Spring Rest application

#11
I also encounter this error while using following with a `PATCH` request:
```java
public Order markOrderAsPayed(@RequestBody final MultiValueMap<String, String> values) {
...
}
```
The MultiValueMap is from `org.springframework.util`. Changing the Map to `Map<String, String>` resolved the problem for me.

Sorry, but I can't give an explanation why.
Reply

#12
may be too late for this post.

if you can add this media type in your controller class for consumes={MediaType.APPLICATION_JSON_UTF8_VALUE} you can get pass this.
Reply

#13
Try removing charset from header Content-type, application json only, and it will probably work.
Reply

#14
I had the same issue when using `@PutMapping` and `@RequestBody` `MultiValueMap<String,String>`. I changed the `MultiValueMap` to Map and it worked, just like what edta had suggested above.
Reply

#15
In my case
I Had two times the same identifier for jsonProperty in my dto class
When I made the request return:
"Content type 'application/json;charset=UTF-8"
Not sure why return that error but once I changed the identifier it works.

[![enter image description here][1]][1]


[1]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through