接口需要在标头中设置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语句:

import java.text.SimpleDateFormat;


注意,您最好转而通过Beanshell使用JSR223组件

关于java - 在Beanshell中获取RFC1123_time(使用JMeter),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56427965/

10-09 05:12