io.airlift.http.client.Request.getMethod()方法的使用及代码示例

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

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

Request.getMethod介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

  1. private static <T> T handleProxyException(Request request, ProxyException e)
  2. {
  3. log.warn(e, "Proxy request failed: %s %s", request.getMethod(), request.getUri());
  4. throw badRequest(BAD_GATEWAY, e.getMessage());
  5. }

代码示例来源:origin: prestodb/presto

  1. if (request.getMethod().equals("DELETE")) {
  2. assertEquals(parts.size(), 1);
  3. return new TestingResponse(HttpStatus.OK, ImmutableListMultimap.of(), new byte[0]);

代码示例来源:origin: prestodb/presto

  1. @Override
  2. public Response handle(Request request)
  3. if (request.getMethod().equalsIgnoreCase("DELETE")) {
  4. return new TestingResponse(HttpStatus.NO_CONTENT, ImmutableListMultimap.of(), new byte[0]);

代码示例来源:origin: prestosql/presto

  1. private static <T> T handleProxyException(Request request, ProxyException e)
  2. {
  3. log.warn(e, "Proxy request failed: %s %s", request.getMethod(), request.getUri());
  4. throw badRequest(BAD_GATEWAY, e.getMessage());
  5. }

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

  1. stats.recordResponseReceived(request.getMethod(),
  2. 0,
  3. 0,
  4. stats.recordResponseReceived(request.getMethod(),
  5. 0,
  6. 0,
  7. stats.recordResponseReceived(request.getMethod(),
  8. response.getStatusCode(),
  9. response.getBytesRead(),

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

  1. Invocation invocation;
  2. if (request.getBodyGenerator() == null) {
  3. invocation = invocationBuilder.build(request.getMethod());
  4. byte[] bytes = byteArrayOutputStream.toByteArray();
  5. Entity<byte[]> entity = Entity.entity(bytes, (String) getOnlyElement(requestHeaders.get("Content-Type")));
  6. invocation = invocationBuilder.build(request.getMethod(), entity);
  7. log.warn(exception.getCause(), "%-8s %s -> Exception", request.getMethod(), request.getUri());
  8. log.warn(throwable, "%-8s %s -> Fail", request.getMethod(), request.getUri());
  9. log.warn("%-8s %s -> OK", request.getMethod(), request.getUri());

代码示例来源:origin: com.teradata.airlift/http-client

  1. @Test
  2. public void testRequestBuilder()
  3. {
  4. Request request = createRequest();
  5. assertEquals(request.getMethod(), "GET");
  6. assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
  7. assertEquals(request.getUri(), URI.create("http://example.com"));
  8. assertEquals(request.getHeaders(), ImmutableListMultimap.of(
  9. "newheader", "withvalue", "anotherheader", "anothervalue"));
  10. }

代码示例来源:origin: io.airlift/http-client

  1. @Test
  2. public void testRequestBuilder()
  3. {
  4. Request request = createRequest();
  5. assertEquals(request.getMethod(), "GET");
  6. assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
  7. assertEquals(request.getUri(), URI.create("http://example.com"));
  8. assertEquals(request.getHeaders(), ImmutableListMultimap.of(
  9. "newheader", "withvalue", "anotherheader", "anothervalue"));
  10. assertFalse(request.isFollowRedirects());
  11. }

代码示例来源:origin: io.airlift/http-client-experimental

  1. @Test
  2. public void testRequestBuilder()
  3. {
  4. Request request = createRequest();
  5. assertEquals(request.getMethod(), "GET");
  6. assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
  7. assertEquals(request.getUri(), URI.create("http://example.com"));
  8. assertEquals(request.getHeaders(), ImmutableListMultimap.of(
  9. "newheader", "withvalue", "anotherheader", "anothervalue"));
  10. }

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

  1. @Test
  2. public void testRequestBuilder()
  3. {
  4. Request request = createRequest();
  5. assertEquals(request.getMethod(), "GET");
  6. assertEquals(request.getBodyGenerator(), NULL_BODY_GENERATOR);
  7. assertEquals(request.getUri(), URI.create("http://example.com"));
  8. assertEquals(request.getHeaders(), ImmutableListMultimap.of(
  9. "newheader", "withvalue", "anotherheader", "anothervalue"));
  10. assertFalse(request.isFollowRedirects());
  11. }

代码示例来源:origin: io.airlift/jaxrs-testing

  1. Invocation invocation;
  2. if (request.getBodyGenerator() == null) {
  3. invocation = invocationBuilder.build(request.getMethod());
  4. byte[] bytes = byteArrayOutputStream.toByteArray();
  5. Entity<byte[]> entity = Entity.entity(bytes, (String) getOnlyElement(requestHeaders.get("Content-Type")));
  6. invocation = invocationBuilder.build(request.getMethod(), entity);
  7. log.warn(exception.getCause(), "%-8s %s -> Exception", request.getMethod(), request.getUri());
  8. log.warn(throwable, "%-8s %s -> Fail", request.getMethod(), request.getUri());
  9. log.warn("%-8s %s -> OK", request.getMethod(), request.getUri());

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

  1. static void recordRequestComplete(RequestStats requestStats, Request request, long requestStart, JettyResponse response, long responseStart)
  2. {
  3. if (response == null) {
  4. return;
  5. }
  6. Duration responseProcessingTime = Duration.nanosSince(responseStart);
  7. Duration requestProcessingTime = new Duration(responseStart - requestStart, NANOSECONDS);
  8. requestStats.recordResponseReceived(request.getMethod(),
  9. response.getStatusCode(),
  10. response.getBytesRead(),
  11. response.getBytesRead(),
  12. requestProcessingTime,
  13. responseProcessingTime);
  14. }
  15. }

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

  1. public static Builder fromRequest(Request request)
  2. {
  3. return new Builder()
  4. .setUri(request.getUri())
  5. .setMethod(request.getMethod())
  6. .addHeaders(request.getHeaders())
  7. .setBodyGenerator(request.getBodyGenerator())
  8. .setFollowRedirects(request.isFollowRedirects())
  9. .setPreserveAuthorizationOnRedirect(request.isPreserveAuthorizationOnRedirect());
  10. }

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

  1. if (request.getMethod().equals("DELETE")) {
  2. assertEquals(parts.size(), 1);
  3. return new TestingResponse(HttpStatus.OK, ImmutableListMultimap.of(), new byte[0]);

代码示例来源:origin: prestosql/presto

  1. if (request.getMethod().equals("DELETE")) {
  2. assertEquals(parts.size(), 1);
  3. return new TestingResponse(HttpStatus.OK, ImmutableListMultimap.of(), new byte[0]);

代码示例来源:origin: io.prestosql/presto-main

  1. if (request.getMethod().equals("DELETE")) {
  2. assertEquals(parts.size(), 1);
  3. return new TestingResponse(HttpStatus.OK, ImmutableListMultimap.of(), new byte[0]);

代码示例来源:origin: prestosql/presto

  1. @Override
  2. public Response handle(Request request)
  3. if (request.getMethod().equalsIgnoreCase("DELETE")) {
  4. return new TestingResponse(HttpStatus.NO_CONTENT, ImmutableListMultimap.of(), new byte[0]);

代码示例来源:origin: io.prestosql/presto-main

  1. @Override
  2. public Response handle(Request request)
  3. if (request.getMethod().equalsIgnoreCase("DELETE")) {
  4. return new TestingResponse(HttpStatus.NO_CONTENT, ImmutableListMultimap.of(), new byte[0]);

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

  1. throws Exception
  2. if (request.getMethod().equalsIgnoreCase("DELETE")) {
  3. return new TestingResponse(HttpStatus.NO_CONTENT, ImmutableListMultimap.<String, String>of(), new byte[0]);

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

  1. jettyRequest.method(finalRequest.getMethod());

相关文章