feign.Request.httpMethod()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(475)

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

Request.httpMethod介绍

暂无

代码示例

代码示例来源:origin: spring-cloud/spring-cloud-openfeign

private Request toRequest(Request request) {
  Map<String, Collection<String>> headers = new LinkedHashMap<>(
      request.headers());
  return Request.create(request.httpMethod(), getUri().toASCIIString(), headers,
      request.requestBody());
}

代码示例来源:origin: org.springframework.cloud/spring-cloud-openfeign-core

private Request toRequest(Request request) {
  Map<String, Collection<String>> headers = new LinkedHashMap<>(
      request.headers());
  return Request.create(request.httpMethod(), getUri().toASCIIString(), headers,
      request.requestBody());
}

代码示例来源:origin: io.github.openfeign/feign-okhttp

HttpMethod.POST == input.httpMethod() || HttpMethod.PUT == input.httpMethod()
    || HttpMethod.PATCH == input.httpMethod();
if (isMethodWithBody) {
 requestBuilder.removeHeader("Content-Type");
requestBuilder.method(input.httpMethod().name(), body);
return requestBuilder.build();

代码示例来源:origin: org.springframework.cloud/spring-cloud-openfeign-core

@Override
public HttpMethod getMethod() {
  return HttpMethod
      .resolve(RibbonRequest.this.toRequest().httpMethod().name());
}

代码示例来源:origin: spring-cloud/spring-cloud-openfeign

@Override
public HttpMethod getMethod() {
  return HttpMethod
      .resolve(RibbonRequest.this.toRequest().httpMethod().name());
}

代码示例来源:origin: io.github.openfeign/feign-httpclient

HttpUriRequest toHttpUriRequest(Request request, Request.Options options)
  throws URISyntaxException {
 RequestBuilder requestBuilder = RequestBuilder.create(request.httpMethod().name());

代码示例来源:origin: org.springframework.cloud/spring-cloud-openfeign-core

@Override
public RequestSpecificRetryHandler getRequestSpecificRetryHandler(
    RibbonRequest request, IClientConfig requestConfig) {
  if (this.ribbon.isOkToRetryOnAllOperations()) {
    return new RequestSpecificRetryHandler(true, true, this.getRetryHandler(),
        requestConfig);
  }
  if (!request.toRequest().httpMethod().name().equals("GET")) {
    return new RequestSpecificRetryHandler(true, false, this.getRetryHandler(),
        requestConfig);
  }
  else {
    return new RequestSpecificRetryHandler(true, true, this.getRetryHandler(),
        requestConfig);
  }
}

代码示例来源:origin: spring-cloud/spring-cloud-openfeign

@Override
public RequestSpecificRetryHandler getRequestSpecificRetryHandler(
    RibbonRequest request, IClientConfig requestConfig) {
  if (this.ribbon.isOkToRetryOnAllOperations()) {
    return new RequestSpecificRetryHandler(true, true, this.getRetryHandler(),
        requestConfig);
  }
  if (!request.toRequest().httpMethod().name().equals("GET")) {
    return new RequestSpecificRetryHandler(true, false, this.getRetryHandler(),
        requestConfig);
  }
  else {
    return new RequestSpecificRetryHandler(true, true, this.getRetryHandler(),
        requestConfig);
  }
}

代码示例来源:origin: twitch4j/twitch4j

throw new UnauthorizedException()
    .addContextValue("requestUrl", response.request().url())
    .addContextValue("requestMethod", response.request().httpMethod())
    .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
    .addContextValue("responseBody", responseBody);
  throw new NotFoundException()
    .addContextValue("requestUrl", response.request().url())
    .addContextValue("requestMethod", response.request().httpMethod())
    .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
    .addContextValue("responseBody", responseBody);
return new ContextedRuntimeException("Helix API Error")
  .addContextValue("requestUrl", response.request().url())
  .addContextValue("requestMethod", response.request().httpMethod())
  .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
  .addContextValue("responseBody", responseBody)

代码示例来源:origin: twitch4j/twitch4j

throw new UnauthorizedException()
    .addContextValue("requestUrl", response.request().url())
    .addContextValue("requestMethod", response.request().httpMethod())
    .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
    .addContextValue("responseBody", responseBody);
  throw new NotFoundException()
    .addContextValue("requestUrl", response.request().url())
    .addContextValue("requestMethod", response.request().httpMethod())
    .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
    .addContextValue("responseBody", responseBody);
return new ContextedRuntimeException("Helix API Error")
  .addContextValue("requestUrl", response.request().url())
  .addContextValue("requestMethod", response.request().httpMethod())
  .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
  .addContextValue("responseBody", responseBody)

代码示例来源:origin: twitch4j/twitch4j

throw new UnauthorizedException()
    .addContextValue("requestUrl", response.request().url())
    .addContextValue("requestMethod", response.request().httpMethod())
    .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
    .addContextValue("responseBody", responseBody);
  throw new NotFoundException()
    .addContextValue("requestUrl", response.request().url())
    .addContextValue("requestMethod", response.request().httpMethod())
    .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
    .addContextValue("responseBody", responseBody);
return new ContextedRuntimeException("Helix API Error")
  .addContextValue("requestUrl", response.request().url())
  .addContextValue("requestMethod", response.request().httpMethod())
  .addContextValue("requestHeaders", response.request().headers().entrySet().toString())
  .addContextValue("responseBody", responseBody)

相关文章