public RequestBuilder uri(URI uri) { if (uri.getScheme() != null) { if (!uri.getScheme().equals("http") && !uri.getScheme().equals("https")) { throw new IllegalArgumentException("URI scheme must be http or https"); } this.secure = uri.getScheme().equals("https"); } this.uri = uri; host(uri.getHost()); return this; }
/** * Returns a simple request builder. The initial request is "GET / HTTP/1.1" from * 127.0.0.1 over an insecure connection. The request is created using the default * factory. */ public RequestBuilder() { this(new DefaultRequestFactory(HttpConfiguration.createWithDefaults())); // Add a host of "localhost" to validate against the AllowedHostsFilter. this.host("localhost"); }
/** * Returns a simple request builder. The initial request is "GET / HTTP/1.1" from * 127.0.0.1 over an insecure connection. The request is created using the default * factory. */ public RequestBuilder() { this(new DefaultRequestFactory(HttpConfiguration.createWithDefaults())); // Add a host of "localhost" to validate against the AllowedHostsFilter. this.host("localhost"); }
/** * Returns a simple request builder. The initial request is "GET / HTTP/1.1" from * 127.0.0.1 over an insecure connection. The request is created using the default * factory. */ public RequestBuilder() { this(new DefaultRequestFactory(HttpConfiguration.createWithDefaults())); // Add a host of "localhost" to validate against the AllowedHostsFilter. this.host("localhost"); }
/** * Returns a simple request builder, based on get and local address. */ public RequestBuilder() { method("GET"); uri("/"); host("localhost"); version("HTTP/1.1"); remoteAddress("127.0.0.1"); body(play.api.mvc.AnyContentAsEmpty$.MODULE$); }