Tabnine Logo
HttpRequest.getRequestLine
Code IndexAdd Tabnine to your IDE (free)

How to use
getRequestLine
method
in
org.jclouds.http.HttpRequest

Best Java code snippets using org.jclouds.http.HttpRequest.getRequestLine (Showing top 20 results out of 1,026)

origin: stackoverflow.com

URI requestURI = new URI(request.getRequestLine().getUri());
URI absoluteRequestURI = URIUtils.rewriteURI(requestURI, target, true);
uri = URIUtils.resolve(absoluteRequestURI, uri); 
origin: org.jclouds/jclouds-core

@Override
public String toString() {
 if (request instanceof GeneratedHttpRequest) {
   GeneratedHttpRequest gRequest = GeneratedHttpRequest.class.cast(request);
   return String.format("[method=%s, request=%s]", gRequest.getInvocation(), gRequest.getRequestLine());
 }
 return "[request=" + request.getRequestLine() + "]";
}
origin: jclouds/legacy-jclouds

public AWSResponseException(HttpCommand command, HttpResponse response, AWSError error) {
 super(String.format("request %s failed with code %s, error: %s", command.getCurrentRequest().getRequestLine(), response
      .getStatusCode(), error.toString()), command, response);
 this.setError(error);
}
origin: jclouds/legacy-jclouds

private HttpCommand toCommand(String commandName, Invocation invocation) {
 logger.trace(">> converting %s", commandName);
 HttpRequest request = annotationProcessor.apply(invocation);
 logger.trace("<< converted %s to %s", commandName, request.getRequestLine());
 return new HttpCommand(request);
}
origin: io.cloudsoft.jclouds/jclouds-core

private HttpCommand toCommand(String commandName, Invocation invocation) {
 logger.trace(">> converting %s", commandName);
 HttpRequest request = annotationProcessor.apply(invocation);
 logger.trace("<< converted %s to %s", commandName, request.getRequestLine());
 return new HttpCommand(request);
}
origin: jclouds/legacy-jclouds

public HttpResponseException(HttpCommand command, HttpResponse response) {
 this(String.format("request: %s %sfailed with response: %s", command.getCurrentRequest().getRequestLine(),
    requestPayloadIfStringOrFormIfNotReturnEmptyString(command.getCurrentRequest()),
    response.getStatusLine()), command, response);
}
origin: io.cloudsoft.jclouds/jclouds-core

public HttpResponseException(HttpCommand command, HttpResponse response) {
 this(String.format("request: %s %sfailed with response: %s", command.getCurrentRequest().getRequestLine(),
    requestPayloadIfStringOrFormIfNotReturnEmptyString(command.getCurrentRequest()),
    response.getStatusLine()), command, response);
}
origin: jclouds/legacy-jclouds

public void testAddingBase64EncodedQueryParamCausingPlusToUrlEncodedSpaceConversion() {
 String base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
 URI uri = URI
    .create("http://goo.com:443?header1=valueWithUrlEncoded%2BPlus");
 HttpRequest request = HttpRequest.builder().method("GET").endpoint(uri)
 // addQueryParam invocation causes %2B's in prev. params to
 // convert to %20.
    .addQueryParam("header2", base64Chars).build();
 assertEquals(
    request.getRequestLine(),
    "GET http://goo.com:443?header1=valueWithUrlEncoded%20Plus&header2=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%20/%3D HTTP/1.1");
}
origin: jclouds/legacy-jclouds

@Override
public HttpResponse invoke(HttpCommand command) {
 assertEquals(command.getCurrentRequest().getRequestLine(), "GET http://howdyboys/client/1/foo HTTP/1.1");
 return HttpResponse.builder().build();
}
origin: jclouds/legacy-jclouds

@Override
public HttpResponse invoke(HttpCommand command) {
 assertEquals(command.getCurrentRequest().getRequestLine(),
    "GET http://localhost:9999/client/1/foo HTTP/1.1");
 return HttpResponse.builder().build();
}
origin: jclouds/legacy-jclouds

@Override
public HttpResponse invoke(HttpCommand command) {
 assertEquals(command.getCurrentRequest().getRequestLine(), "GET http://howdyboys/client/1/foo HTTP/1.1");
 return HttpResponse.builder().build();
}
origin: jclouds/legacy-jclouds

  @Test
  public void testWithPrimitive() {
   HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://momma/").build();

   BindIdsToQueryParams binder = new BindIdsToQueryParams();

   request = binder.bindToRequest(request, new long[] { 123L, 456L });

   assertEquals(request.getRequestLine(), "GET http://momma/?id=123&id=456 HTTP/1.1");
  }
}
origin: jclouds/legacy-jclouds

@Test
public void testBinding() {
 String[] input = { "hello", "world" };
 HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://momma/").build();
 BindNamesToQueryParams binder = new BindNamesToQueryParams();
 request = binder.bindToRequest(request, input);
 assertEquals(request.getRequestLine(), "GET http://momma/?name=hello&name=world HTTP/1.1");
}
origin: jclouds/legacy-jclouds

public HTTPRequest filterLogAndConvertRe(HttpRequest request) {
 for (HttpRequestFilter filter : request.getFilters()) {
   request = filter.filter(request);
 }
 checkRequestHasContentLengthOrChunkedEncoding(request,
    "After filtering, the request has neither chunked encoding nor content length: " + request);
 logger.debug("Sending request %s: %s", request.hashCode(), request.getRequestLine());
 wirePayloadIfEnabled(wire, request);
 HTTPRequest nativeRequest = convertToGaeRequest.apply(request);
 utils.logRequest(headerLog, request, ">>");
 return nativeRequest;
}
origin: jclouds/legacy-jclouds

public void testAuthorizeIngressICMPToCIDRs() throws SecurityException, NoSuchMethodException, IOException {
 Invokable<?, ?> method = method(SecurityGroupAsyncClient.class, "authorizeIngressICMPToCIDRs", String.class , int.class,
    int.class, Iterable.class, AccountInDomainOptions[].class);
 GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(2, 22, 22, ImmutableSet.of("1.1.1.1/24", "1.2.2.2/16")));
 assertRequestLineEquals(httpRequest, authorizeSecurityGroupIngress1.getRequestLine());
 assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
 assertPayloadEquals(httpRequest, null, null, false);
 assertResponseParserClassEquals(method, httpRequest, ParseFirstJsonValueNamed.class);
 assertSaxResponseParserClassEquals(method, null);
 assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
 checkFilters(httpRequest);
}
origin: jclouds/legacy-jclouds

public void testCreateServiceOffering() throws Exception {
 Invokable<?, ?> method = method(GlobalOfferingAsyncClient.class, "createServiceOffering",
   String.class, String.class, int.class, int.class, int.class, CreateServiceOfferingOptions[].class);
 GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("name", "displayText", 1, 2, 3));
 assertRequestLineEquals(httpRequest, createServiceOffering.getRequestLine());
 assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
 assertPayloadEquals(httpRequest, null, null, false);
 assertResponseParserClassEquals(method, httpRequest, ParseFirstJsonValueNamed.class);
 assertSaxResponseParserClassEquals(method, null);
 assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
 checkFilters(httpRequest);
}
origin: jclouds/legacy-jclouds

public void testCopyTemplate() throws NoSuchMethodException {
 Invokable<?, ?> method = method(TemplateAsyncClient.class, "copyTemplateToZone", String.class, String.class, String.class);
 GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(17, 18, 19));
 assertRequestLineEquals(httpRequest,copyTemplate.getRequestLine());
 assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
 assertPayloadEquals(httpRequest, null, null, false);
 assertResponseParserClassEquals(method, httpRequest, UnwrapOnlyJsonValue.class);
 assertSaxResponseParserClassEquals(method, null);
 assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
 checkFilters(httpRequest);
}
origin: jclouds/legacy-jclouds

public void testCreateNetworkInZone() throws SecurityException, NoSuchMethodException, IOException {
 Invokable<?, ?> method = method(NetworkAsyncClient.class, "createNetworkInZone", String.class, String.class, String.class,
    String.class, CreateNetworkOptions[].class);
 GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(1, 2, "named", "lovely"));
 assertRequestLineEquals(httpRequest, createNetwork.getRequestLine());
 assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
 assertPayloadEquals(httpRequest, null, null, false);
 assertResponseParserClassEquals(method, httpRequest, ParseFirstJsonValueNamed.class);
 assertSaxResponseParserClassEquals(method, null);
 assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
 checkFilters(httpRequest);
}
origin: jclouds/legacy-jclouds

  public void testExtractISOOptions() throws NoSuchMethodException {
   Invokable<?, ?> method = method(ISOAsyncClient.class, "extractISO", String.class, ExtractMode.class, String.class, ExtractISOOptions[].class);
   GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(3, ExtractMode.HTTP_DOWNLOAD, 5, ExtractISOOptions.Builder.url("http://example.com/")));

   assertRequestLineEquals(httpRequest, extractIsoOptions.getRequestLine());
   assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
   assertPayloadEquals(httpRequest, null, null, false);

   assertResponseParserClassEquals(method, httpRequest, UnwrapOnlyJsonValue.class);
   assertSaxResponseParserClassEquals(method, null);
   assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);

   checkFilters(httpRequest);
  }
}
origin: jclouds/legacy-jclouds

public void testRegisterTemplate() throws NoSuchMethodException {
 Invokable<?, ?> method = method(TemplateAsyncClient.class, "registerTemplate", TemplateMetadata.class, String.class, String.class, String.class, String.class, RegisterTemplateOptions[].class);
 GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(TemplateMetadata.builder().name("thename").osTypeId("10").displayText("description").build(), Template.Format.QCOW2, "xen", "http://example.com/", 20));
 assertRequestLineEquals(httpRequest, registerTemplate.getRequestLine());
 assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
 assertPayloadEquals(httpRequest, null, null, false);
 assertResponseParserClassEquals(method, httpRequest, ParseFirstJsonValueNamed.class);
 assertSaxResponseParserClassEquals(method, null);
 assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
 checkFilters(httpRequest);
}
org.jclouds.httpHttpRequestgetRequestLine

Popular methods of HttpRequest

  • getMethod
    We cannot return an enum, as per specification custom methods are allowed. Enums are not extensible.
  • toBuilder
  • getPayload
  • getEndpoint
  • builder
  • setPayload
  • getHeaders
  • getFirstHeaderOrNull
  • getFilters
  • hashCode
  • <init>
  • addHeader
  • <init>,
  • addHeader,
  • addParser,
  • containsHeader,
  • execute,
  • getAllHeaders,
  • getAttribute,
  • getContent,
  • getHttpBody

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Runner (org.openjdk.jmh.runner)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now