gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-13 09:34:29 27 4
gpt4 key购买 nike

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

ZestRequest.getMethod介绍

[英]Gets the method.
[中]获取方法。

代码示例

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

/**
 * Sets the standard variables for a request.
 *
 * @param request the new standard variables
 */
@Override
public void setStandardVariables(ZestRequest request) {
  if (request != null) {
    if (request.getUrl() != null) {
      this.setVariable(ZestVariables.REQUEST_URL, request.getUrl().toString());
    }
    this.setVariable(ZestVariables.REQUEST_HEADER, request.getHeaders());
    this.setVariable(ZestVariables.REQUEST_METHOD, request.getMethod());
    this.setVariable(ZestVariables.REQUEST_BODY, request.getData());
  }
}

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

assertThat(deserialisedRequest.getUrl()).isEqualTo(url);
assertThat(deserialisedRequest.getUrlToken()).isEqualTo(urlToken);
assertThat(deserialisedRequest.getMethod()).isEqualTo(method);
assertThat(deserialisedRequest.getHeaders()).isEqualTo(headers);
assertThat(deserialisedRequest.getData()).isEqualTo(data);

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

ZestRequest req = (ZestRequest) stmt;
printIndent(indent, stmt.getIndex());
System.out.println(req.getMethod() + " " + req.getUrl());
if (req.getHeaders() != null && req.getHeaders().length() > 0) {
  printIndent(indent + 1);

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

URI uri = new URI(req.getUrl().toString(), false);
switch (req.getMethod()) {
  case "GET":
    method = new GetMethod(uri.toString());
    break;
  default:
    throw new IllegalArgumentException("Method not supported: " + req.getMethod());
    && !req.getMethod().equals("GET")) {
    this.debug(req.getMethod() + " : " + req.getUrl());
    code = httpclient.executeMethod(method);

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

assertThat(request).isNotNull();
assertThat(request.getTimestamp()).isCloseTo(System.currentTimeMillis(), byLessThan(2000L));
assertThat(request.getMethod()).isEqualTo(method);
assertThat(request.getUrl()).isEqualTo(url);
assertThat(request.getHeaders()).isEqualTo(headers);

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

@Override
public void setStandardVariables(ZestRequest request) {
  if (request != null) {
    if (request.getUrl() != null) {
      this.setVariable(ZestVariables.REQUEST_URL, request.getUrl().toString());
    }
    this.setVariable(ZestVariables.REQUEST_HEADER, request.getHeaders());
    this.setVariable(ZestVariables.REQUEST_METHOD, request.getMethod());
    this.setVariable(ZestVariables.REQUEST_BODY, request.getData());
  }
}

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

/**
 * Replace tokens.
 *
 * @param tokens the tokens
 */
public void replaceTokens(ZestVariables tokens) {
  if (this.urlToken != null) {
    this.setUrlToken(tokens.replaceInString(this.urlToken, true));
    try {
      this.setUrl(new URL(this.getUrlToken()));
    } catch (MalformedURLException e) {
      // Ignore
    }
  } else if (this.url != null) {
    try {
      this.setUrl(new URL(tokens.replaceInString(this.url.toString(), true)));
    } catch (MalformedURLException e) {
      // Ignore
    }
  }
  this.setMethod(tokens.replaceInString(this.getMethod(), false));
  this.setHeaders(tokens.replaceInString(this.getHeaders(), false));
  this.setData(tokens.replaceInString(this.getData(), false));
  for (ZestCookie cookie : this.cookies) {
    cookie.setDomain(tokens.replaceInString(cookie.getDomain(), false));
    cookie.setName(tokens.replaceInString(cookie.getName(), false));
    cookie.setValue(tokens.replaceInString(cookie.getValue(), false));
    cookie.setPath(tokens.replaceInString(cookie.getPath(), false));
  }
}

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

this.lastRequest = ((ZestRequest) stmt).deepCopy();
this.lastRequest.replaceTokens(this.variables);
this.debug(this.lastRequest.getMethod() + " : " + this.lastRequest.getUrl());
this.lastResponse = send(this.lastRequest);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com