如何在jmeter中解码base 64格式? [英] How to decode base 64 format in jmeter?
本文介绍了如何在jmeter中解码base 64格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有谁知道在 JMeter 中解码 base 64 格式字符串的解决方案?
Does anyone know a solution to decode a base 64 format string in JMeter?
我必须解码响应,但我不想重新发明轮子...
I have to decode the a response, but i don't want to reinvent the wheel...
我必须自己编写代码吗(希望不要)?
Do i have to write the code by myself (hope not)?
谢谢
推荐答案
我目前的解决方案是:
import org.apache.commons.codec.binary.Base64;
log.info("Decoding base64 format");
String response = "b3JpZ2luYWwgU3RyaW5nIGJlZm9yZSBiYXNlNjQgZW5jb2RpbmcgaW4gSmF2YQ==";
byte[] decoded_response = Base64.decodeBase64(response);
log.info(new String(decoded_response));
基于http://javarevisited.blogspot.pt/2012/02/how-to-encode-decode-string-in-java.html .
查看 Dmitri 解决方案以获取更多详细信息.
Check Dmitri solution for more details.
谢谢
这篇关于如何在jmeter中解码base 64格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文