接口(interface)需要在 header 中设置 RFC1123 时间 我无法使用 JMeter 在 beanshell 中执行此操作
我知道代码可以在 java 中运行:
SimpleDateFormat sdf3 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z",Locale.US);
sdf3.setTimeZone(TimeZone.getTimeZone("GMT"));
String rfc1123_3 = sdf3.format(new Date());
但我无法在 Beanshell 脚本中运行它
最佳答案
您必须在代码开头添加导入语句:
import java.text.SimpleDateFormat;
请注意,您最好改用 JSR223 组件而不是 Beanshell
关于java - 在 Beanshell 中获取 RFC1123_time (使用 JMeter),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56427965/