org.mozilla.zest.core.v1.ZestRequest.setTimestamp()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(70)

本文整理了Java中org.mozilla.zest.core.v1.ZestRequest.setTimestamp()方法的一些代码示例,展示了ZestRequest.setTimestamp()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestRequest.setTimestamp()方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestRequest
类名称:ZestRequest
方法名:setTimestamp

ZestRequest.setTimestamp介绍

[英]Sets when the request was sent (unix time).
[中]设置发送请求的时间(unix时间)。

代码示例

代码示例来源:origin: mozilla/zest

request.setFollowRedirects(followRedirects);
long timestamp = Instant.now().toEpochMilli();
request.setTimestamp(timestamp);

代码示例来源:origin: mozilla/zest

String responseBody = null;
Date start = new Date();
req.setTimestamp(start.getTime());
try {
  code = httpclient.executeMethod(method);

代码示例来源:origin: mozilla/zest

req.setHeaders("Set-Cookie: test={{token2}}");
req.setData("test={{token3}}&user=12{{token3}}34");
req.setTimestamp(Instant.now().toEpochMilli());
req.addCookie(
    new ZestCookie(

代码示例来源:origin: mozilla/zest

@Override
public ZestRequest deepCopy() {
  ZestRequest zr = new ZestRequest(this.getIndex());
  zr.setUrl(this.url);
  zr.setUrlToken(this.urlToken);
  zr.setData(this.data);
  zr.setMethod(this.method);
  zr.setHeaders(this.headers);
  zr.setFollowRedirects(this.followRedirects);
  zr.setTimestamp(this.timestamp);
  if (this.getResponse() != null) {
    zr.setResponse(this.getResponse().deepCopy());
  }
  for (ZestAssertion zt : this.getAssertions()) {
    zr.addAssertion((ZestAssertion) zt.deepCopy());
  }
  for (ZestCookie cookie : this.cookies) {
    zr.addCookie(
        new ZestCookie(
            cookie.getDomain(),
            cookie.getName(),
            cookie.getValue(),
            cookie.getPath(),
            cookie.getExpiryDate(),
            cookie.isSecure()));
  }
  zr.setEnabled(this.isEnabled());
  return zr;
}

相关文章