当前位置:网站首页>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);
边栏推荐
- byte2String、string2Byte
- II. Data type
- Ecplise development environment configuration and simple web project construction
- MySQL view
- Learn JVM garbage collection 05 - root node enumeration, security points, and security zones (hotspot)
- Add a new cloud disk to Huawei virtual machine
- Leetcode-1. Sum of two numbers (Application of hash table)
- Four operations and derivative operations of MATLAB polynomials
- 【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
- MySQL stored procedure
猜你喜欢

Tabbar configuration at the bottom of wechat applet

7月华清学习-1

强化学习-学习笔记3 | 策略学习

Pytorch two-layer loop to realize the segmentation of large pictures

About cache exceptions: solutions for cache avalanche, breakdown, and penetration

Implementing Yang Hui triangle with cyclic queue C language

Ecplise development environment configuration and simple web project construction

Redis highly available sentinel mechanism

What is digital existence? Digital transformation starts with digital existence

Distributed cache architecture - cache avalanche & penetration & hit rate
随机推荐
PIP command reports an error pip is configured with locations that requires tls/ssl problems
Take you two minutes to quickly master the route and navigation of flutter
Learning items
The evolution of mobile cross platform technology
Learn JVM garbage collection 05 - root node enumeration, security points, and security zones (hotspot)
Learn the garbage collector of JVM -- a brief introduction to Shenandoah collector
MySQL splits strings for conditional queries
ZABBIX agent2 monitors mongodb nodes, clusters and templates (official blog)
Select drop-down box realizes three-level linkage of provinces and cities in China
PXE startup configuration and principle
Pytoch loads the initialization V3 pre training model and reports an error
Pytorch two-layer loop to realize the segmentation of large pictures
Storage Basics
Knowledge representation (KR)
Introduction to GNN
Distributed solution - distributed lock solution - redis based distributed lock implementation
Distributed solution - Comprehensive decryption of distributed task scheduling platform - xxljob scheduling center cluster
JDBC -- use JDBC connection to operate MySQL database
ZABBIX agent2 monitors mongodb templates and configuration operations
Leetcode-1. Sum of two numbers (Application of hash table)