@Test public void testOtherMethodRequest() throws Exception { server.requestHandler(r -> { assertEquals(HttpMethod.OTHER, r.method()); assertEquals("COPY", r.rawMethod()); r.response().end(); }).listen(onSuccess(s -> { client.request(HttpMethod.OTHER, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath", resp -> { testComplete(); }).setRawMethod("COPY").end(); })); await(); }
/** * Set the value the method to send when the method is used. * @param method the raw method * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpClientRequest setRawMethod(String method) { delegate.setRawMethod(method); return this; }
clientRequest.setRawMethod(proxyRequest.rawMethod());
/** * Set the value the method to send when the method is used. * @param method the raw method * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpClientRequest setRawMethod(String method) { delegate.setRawMethod(method); return this; }
@Test public void testOtherMethodRequest() throws Exception { server.requestHandler(r -> { assertEquals(HttpMethod.OTHER, r.method()); assertEquals("COPY", r.rawMethod()); r.response().end(); }).listen(onSuccess(s -> { client.request(HttpMethod.OTHER, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath", resp -> { testComplete(); }).setRawMethod("COPY").end(); })); await(); }
public ProxyRequestImpl(HttpClient client, SocketAddress target, HttpServerRequest request) { this(req -> { HttpMethod method = req.method(); HttpClientRequest backRequest = client.request(method, target.port(), target.host(), req.uri()); if (method == HttpMethod.OTHER) { backRequest.setRawMethod(req.rawMethod()); } return backRequest; }, request); }
clientRequest.setRawMethod(proxyRequest.rawMethod());
clientRequest.setRawMethod(proxyRequest.rawMethod());
@Test public void testRawMethod(TestContext ctx) throws Exception { Async latch = ctx.async(); SocketAddress backend = startHttpBackend(ctx, 8081, req -> { ctx.assertEquals(HttpMethod.OTHER, req.method()); ctx.assertEquals("FOO", req.rawMethod()); req.response().end(); }); startProxy(backend); HttpClient client = vertx.createHttpClient(); client.request(HttpMethod.OTHER, 8080, "localhost", "/", resp -> latch.complete()).setRawMethod("FOO").end(); }