当前位置:网站首页>解决base64压缩文件,经过post请求解压出来是空格的问题
解决base64压缩文件,经过post请求解压出来是空格的问题
2022-06-23 22:26:00 【XuDream】
使用情景
当一个经过base64压缩过之后的字符串,通过POST请求传值给后端,后端经过base64解压之后是空格。造成这样的原因是经过base64压缩之后,字符串会出现“+”和“/”字符,经过post请求,会转化成空格。
解决方案:
更换压缩写法:
String text = "你好";
String base64encodedString = Base64.getUrlEncoder().encodeToString(text.getBytes("utf-8"));
System.out.println("编码"+base64encodedString);
byte[] base64decodedBytes = Base64.getUrlDecoder().decode(base64encodedString);
System.out.println("解码"+new String(base64decodedBytes, "utf-8"));
边栏推荐
- Hackers can gain administrator privileges by invading Microsoft mail server and windows Zero Day vulnerability November 23 global network security hotspot
- Keywords such as extern and struct
- The first open-source MySQL HTAP database in China will be released soon, and the three highlights will be informed in advance that shiatomics technology will launch heavily
- 利用Scanorama高效整合异质单细胞转录组
- ==What is the difference between and equals?
- 如何利用數倉創建時序錶
- How to get started with machine learning?
- What is medical treatment? AI medical concept analysis AI
- [bug] the element in C iqueryable cannot change its value
- 元宇宙中的社会秩序
猜你喜欢

Quantitative investment model -- research interpretation of high frequency trading market making model (Avellaneda & Stoikov's) & code resources

物联网卡设备接入EasyCVR,如何查看拉流IP以及拉流时间?

逆向工具IDA、GDB使用

解决项目依赖报红问题

2. camera calibration

NLP工程师是干什么的?工作内容是什么?

合成大西瓜小游戏微信小程序源码/微信游戏小程序源码
![[image detection saliency map] calculation of fish eye saliency map based on MATLAB distortion prompt [including Matlab source code 1903]](/img/36/134c573c2198ca6c88a7c179189f1a.jpg)
[image detection saliency map] calculation of fish eye saliency map based on MATLAB distortion prompt [including Matlab source code 1903]

Do280openshift access control -- manage projects and accounts

Android 3年外包工面试笔记,有机会还是要去大厂学习提升,android开发实习面试题
随机推荐
2021-11-23: Regulations: l[1] corresponds to a, l[2] corresponds to B, l[3] corresponds to C
Six necessary open source projects for private activities
Design of message push platform
Keywords such as extern and struct
How to use data warehouse to create time series
Go language core 36 lectures (go language practice and application 11) -- learning notes
Test - use case - detail frenzy
[leetcode notes] no118 Yanghui triangle
[technical grass planting] Tencent Yunhao wool (consumption) record on the double 11
【FreeRTOS】07 二值信号量、计数信号量
js 语言 精度问题
I was cheated by my colleagues to work overtime on weekends. I haven't seen redis used like this...
Android - JNI 开发你所需要知道的基础,Android工程师面试题
Interview notes for Android outsourcing workers for 3 years. I still need to go to a large factory to learn and improve. As an Android programmer
Save: software analysis, verification and test platform
985本3Android程序员40天拿下阿里P6口头offer,面试成功后整理了这些面试思路
2. camera calibration
CPU取指到发出控制、微程序控制原理详细过程
跟着CTF-wiki学pwn——ret2text
【数字信号】基于matlab模拟窗函数频谱细化【含Matlab源码 1906期】