本文整理了Java中io.vertx.ext.web.client.WebClient.getAbs()
方法的一些代码示例,展示了WebClient.getAbs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.getAbs()
方法的具体详情如下:
包路径:io.vertx.ext.web.client.WebClient
类名称:WebClient
方法名:getAbs
暂无
代码示例来源:origin: vert-x3/vertx-examples
String header = "Bearer " + accessToken;
client.getAbs(TWEET_SEARCH_URL)
.as(BodyCodec.jsonObject())
.addQueryParam("q", queryToSearch)
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive
* the response
* @param absoluteURI the absolute URI
* @return an HTTP client request object
*/
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> getAbs(String absoluteURI) {
io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.getAbs(absoluteURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
return ret;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive
* the response
* @param absoluteURI the absolute URI
* @return an HTTP client request object
*/
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> getAbs(String absoluteURI) {
io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.getAbs(absoluteURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
return ret;
}
代码示例来源:origin: io.vertx/vertx-web-client
@Test
public void testTLSEnabledDisableRequestTLSAbsURI() throws Exception {
testTLS(true, false, client -> client.getAbs("http://" + DEFAULT_HTTPS_HOST + ":" + DEFAULT_HTTPS_PORT));
}
代码示例来源:origin: io.vertx/vertx-web-client
@Test
public void testTLSEnabledEnableRequestTLSAbsURI() throws Exception {
testTLS(true, true, client -> client.getAbs("https://" + DEFAULT_HTTPS_HOST + ":" + DEFAULT_HTTPS_PORT));
}
代码示例来源:origin: io.vertx/vertx-web-client
@Test
public void testTLSDisabledDisableRequestTLSAbsURI() throws Exception {
testTLS(false, false, client -> client.getAbs("http://" + DEFAULT_HTTPS_HOST + ":" + DEFAULT_HTTPS_PORT));
}
代码示例来源:origin: io.vertx/vertx-web-client
@Test
public void testTLSDisabledEnableRequestTLSAbsURI() throws Exception {
testTLS(false, true, client -> client.getAbs("https://" + DEFAULT_HTTPS_HOST + ":" + DEFAULT_HTTPS_PORT));
}
代码示例来源:origin: io.vertx/vertx-web-client
/**
* Regression test for issue #563 (https://github.com/vert-x3/vertx-web/issues/563)
* <p>
* Only occurred when {@link WebClientOptions#isSsl()} was false for an SSL request.
*/
@Test
public void testTLSQueryParametersIssue563() throws Exception {
testTLS(false, true,
client -> client.getAbs("https://" + DEFAULT_HTTPS_HOST + ":" + DEFAULT_HTTPS_PORT)
.addQueryParam("query1", "value1")
.addQueryParam("query2", "value2"),
serverRequest -> assertEquals("query1=value1&query2=value2", serverRequest.query()));
}
代码示例来源:origin: io.vertx/vertx-web-client
@Test
public void testHttpProxyFtpRequest() throws Exception {
startProxy(null, ProxyType.HTTP);
proxy.setForceUri("http://" + DEFAULT_HTTP_HOST + ":" + DEFAULT_HTTP_PORT);
server.requestHandler(req -> req.response().setStatusCode(200).end());
startServer();
WebClientOptions options = new WebClientOptions();
options.setProxyOptions(new ProxyOptions().setPort(proxy.getPort()));
WebClient client = WebClient.create(vertx, options);
client
.getAbs("ftp://ftp.gnu.org/gnu/")
.send(ar -> {
if (ar.succeeded()) {
// Obtain response
HttpResponse<Buffer> response = ar.result();
assertEquals(200, response.statusCode());
assertEquals("ftp://ftp.gnu.org/gnu/", proxy.getLastUri());
testComplete();
} else {
fail(ar.cause());
}
});
await();
}
内容来源于网络,如有侵权,请联系作者删除!