public HttpRequest newHttpRequest(final String method, final String uri) throws MethodNotSupportedException { if (isOneOf(RFC2616_COMMON_METHODS, method)) { return new BasicHttpRequest(method, uri); } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) { return new BasicHttpEntityEnclosingRequest(method, uri); } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) { return new BasicHttpRequest(method, uri); } else { throw new MethodNotSupportedException(method + " method not supported"); } }
HttpRequest req = new BasicHttpRequest ("CONNECT", authority, ver);
public HttpRequest newHttpRequest(final RequestLine requestline) throws MethodNotSupportedException { if (requestline == null) { throw new IllegalArgumentException("Request line may not be null"); } String method = requestline.getMethod(); if (isOneOf(RFC2616_COMMON_METHODS, method)) { return new BasicHttpRequest(requestline); } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) { return new BasicHttpEntityEnclosingRequest(requestline); } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) { return new BasicHttpRequest(requestline); } else { throw new MethodNotSupportedException(method + " method not supported"); } }
HttpRequest req = new BasicHttpRequest ("CONNECT", authority, ver);
public HttpRequest newHttpRequest(final String method, final String uri) throws MethodNotSupportedException { if (isOneOf(BASIC, method)) { return new BasicHttpRequest(method, uri); } else if (isOneOf(WITH_ENTITY, method)) { return new BasicHttpEntityEnclosingRequest(method, uri); } else { return super.newHttpRequest(method, uri); } }
proxyRequest = newProxyRequestWithEntity(method, proxyRequestUri, servletRequest); } else { proxyRequest = new BasicHttpRequest(method, proxyRequestUri);
DefaultHttpClient httpclient = new DefaultHttpClient(); BasicHttpRequest httpPurge = new BasicHttpRequest("PURGE", "www.somehost.com") HttpResponse response = httpclient.execute(httpPurge);
HttpHost host = new HttpHost(hostname, port); HttpClient httpclient = HttpClientBuilder.create().build(); BasicHttpRequest purgeRequest = new BasicHttpRequest("PURGE", "/some/url"); HttpResponse response = httpclient.execute(host, purgeRequest);
public static HttpRequest buildRequest(String method, URL url, Header... headers) { BasicHttpRequest request = new BasicHttpRequest(method, url.toExternalForm()); for (Header header : headers) { request.addHeader(header); } return request; }
private JSONObject getNodeStatusJson() throws IOException, JSONException { HttpClient client = new DefaultHttpClient(); String url = "http://" + node.getHost() + ":" + node.getPort() + "/wd/hub/status"; BasicHttpRequest r = new BasicHttpRequest("GET", url); HttpResponse response = client.execute(new HttpHost(node.getHost(), node.getPort()), r); return extractObject(response); }
public static JsonObject main(String pHost, int pPort) throws ClientProtocolException, IOException { URL proxyApi = new URL("http://" + pHost + ":" + pPort + "/grid/admin/GridQueryServlet"); HttpClient client = HttpClientBuilder.create().build(); BasicHttpRequest r = new BasicHttpRequest("GET", proxyApi.toExternalForm()); HttpHost host = new HttpHost(pHost, pPort); HttpResponse response = client.execute(host, r); Assert.assertEquals(200, response.getStatusLine().getStatusCode()); JsonObject o = extractObject(response); return o; }
public static JsonObject main(String pHost, int pPort) throws IOException { URL proxyApi = new URL("http://" + pHost + ":" + pPort + "/grid/admin/GridQueryServlet"); HttpClient client = HttpClientBuilder.create().build(); BasicHttpRequest r = new BasicHttpRequest("GET", proxyApi.toExternalForm()); HttpHost host = new HttpHost(pHost, pPort); HttpResponse response = client.execute(host, r); Assert.assertEquals(200, response.getStatusLine().getStatusCode()); JsonObject o = extractObject(response); return o; }
/** * Deletes a bucket. * * @param name The name of the bucket to delete. */ public void deleteBucket(final String name) { BasicHttpRequest request = new BasicHttpRequest("DELETE", BUCKETS + name); checkForErrorCode(200, sendRequest(request)); }
public HttpRequest newHttpRequest(final String method, final String uri) throws MethodNotSupportedException { if (isOneOf(RFC2616_COMMON_METHODS, method)) { return new BasicHttpRequest(method, uri); } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) { return new BasicHttpEntityEnclosingRequest(method, uri); } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) { return new BasicHttpRequest(method, uri); } else { throw new MethodNotSupportedException(method + " method not supported"); } }
public HttpRequest newHttpRequest(final String method, final String uri) throws MethodNotSupportedException { if (isOneOf(RFC2616_COMMON_METHODS, method)) { return new BasicHttpRequest(method, uri); } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) { return new BasicHttpEntityEnclosingRequest(method, uri); } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) { return new BasicHttpRequest(method, uri); } else { throw new MethodNotSupportedException(method + " method not supported"); } }
public HttpRequest newHttpRequest(final String method, final String uri) throws MethodNotSupportedException { if (isOneOf(RFC2616_COMMON_METHODS, method)) { return new BasicHttpRequest(method, uri); } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) { return new BasicHttpEntityEnclosingRequest(method, uri); } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) { return new BasicHttpRequest(method, uri); } else { throw new MethodNotSupportedException(method + " method not supported"); } }
public HttpRequest newHttpRequest(final String method, final String uri) throws MethodNotSupportedException { if (isOneOf(RFC2616_COMMON_METHODS, method)) { return new BasicHttpRequest(method, uri); } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) { return new BasicHttpEntityEnclosingRequest(method, uri); } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) { return new BasicHttpRequest(method, uri); } else { throw new MethodNotSupportedException(method + " method not supported"); } }
public HttpRequest newHttpRequest(final String method, final String uri) throws MethodNotSupportedException { if (isOneOf(RFC2616_COMMON_METHODS, method)) { return new BasicHttpRequest(method, uri); } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) { return new BasicHttpEntityEnclosingRequest(method, uri); } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) { return new BasicHttpRequest(method, uri); } else { throw new MethodNotSupportedException(method + " method not supported"); } }
public HttpRequest newHttpRequest(final String method, final String uri) throws MethodNotSupportedException { if (isOneOf(RFC2616_COMMON_METHODS, method)) { return new BasicHttpRequest(method, uri); } else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) { return new BasicHttpEntityEnclosingRequest(method, uri); } else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) { return new BasicHttpRequest(method, uri); } else { throw new MethodNotSupportedException(method + " method not supported"); } }
public HttpRequest generateRequest(final HttpContext context) throws IOException, HttpException { HttpHost target = this.route.getTargetHost(); HttpRequest connect = new BasicHttpRequest("CONNECT", target.toHostString(), HttpVersion.HTTP_1_1); connect.setHeader(HttpHeaders.HOST, target.toHostString()); this.httpProcessor.process(connect, context); context.setAttribute(SynapseHTTPRequestFactory.ENDPOINT_URL, target.toString()); return connect; }