当前位置:网站首页>JSON parsing error special character processing (really speechless... Troubleshooting for a long time)
JSON parsing error special character processing (really speechless... Troubleshooting for a long time)
2022-07-05 12:37:00 【Hua Li Hu Shao】
There is a need. I'll give you one http The interface to It is used to save data transmitted from other interfaces
No problem ··
then There is an error in the adjustment org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error
Analyzing the problem is obviously First of all, I thought of the transmission json Is the format wrong Then let's go over there json I found a random one json Analyze the website No problem I know
And then I just Accept json String character string Self use gons analysis
I can't find out · The data format given is like this ··
Just this \ The problem of This hook 8 Given json The string is obviously not standardized That's bullshit There said no tojson Transferred It's a string json··· I'm a thief nm
Solution
use jackson Of ObjectMapper
ObjectMapper objectMapper = new ObjectMapper();
// Automatically handle backslashes
objectMapper.configure(JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER,true);
// Because it's spelled out “json” So what else Space enter
// Special characters and escapes are allowed
objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true);
// Allow to appear Single quotation marks
objectMapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
边栏推荐
- Average lookup length when hash table lookup fails
- Flume common commands and basic operations
- Using MySQL in docker
- MySQL view
- C alarm design
- Flutter2 heavy release supports web and desktop applications
- GPS数据格式转换[通俗易懂]
- Automated test lifecycle
- Redis highly available sentinel mechanism
- Redis highly available slice cluster
猜你喜欢
Why learn harmonyos and how to get started quickly?
UNIX socket advanced learning diary -ipv4-ipv6 interoperability
Knowledge representation (KR)
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
Automated test lifecycle
mysql拆分字符串做条件查询
Learn memory management of JVM 01 - first memory
MySQL index - extended data
Reinforcement learning - learning notes 3 | strategic learning
Keras implements verification code identification
随机推荐
How to design an interface?
Understand redis persistence mechanism in one article
ZABBIX agent2 monitors mongodb templates and configuration operations
Migrate data from Mysql to neo4j database
MySQL data table operation DDL & data type
July Huaqing learning-1
GPS data format conversion [easy to understand]
Distributed solution - Comprehensive decryption of distributed task scheduling platform -xxljob
Redis's memory elimination mechanism, read this article is enough.
Select drop-down box realizes three-level linkage of provinces and cities in China
Keras implements verification code identification
语义分割实验:Unet网络/MSRC2数据集
Kotlin变量
GPON technical standard analysis I
Pytoch uses torchnet Classerrormeter in meter
Preliminary exploration of basic knowledge of MySQL
C alarm design
SENT协议译码的深入探讨
一款新型的智能家居WiFi选择方案——SimpleWiFi在无线智能家居中的应用
Seven polymorphisms