本文整理了Java中com.ning.http.client.uri.Uri.toJavaNetURI()
方法的一些代码示例,展示了Uri.toJavaNetURI()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Uri.toJavaNetURI()
方法的具体详情如下:
包路径:com.ning.http.client.uri.Uri
类名称:Uri
方法名:toJavaNetURI
暂无
代码示例来源:origin: com.ning/async-http-client
public ProxyServer select(Uri uri) {
try {
URI javaUri = uri.toJavaNetURI();
代码示例来源:origin: com.ning/async-http-client
private HttpURLConnection createUrlConnection(Request request) throws IOException, URISyntaxException {
ProxyServer proxyServer = ProxyUtils.getProxyServer(config, request);
Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm();
Proxy proxy = null;
if (proxyServer != null || realm != null) {
try {
proxy = configureProxyAndAuth(proxyServer, realm);
} catch (AuthenticationException e) {
throw new IOException(e.getMessage());
}
}
HttpURLConnection urlConnection = (HttpURLConnection)
request.getUri().toJavaNetURI().toURL().openConnection(proxy == null ? Proxy.NO_PROXY : proxy);
if (request.getUri().getScheme().equals("https")) {
HttpsURLConnection secure = (HttpsURLConnection) urlConnection;
SSLContext sslContext;
try {
sslContext = SslUtils.getInstance().getSSLContext(config);
} catch (GeneralSecurityException e) {
throw new IOException(e.getMessage());
}
secure.setSSLSocketFactory(sslContext.getSocketFactory());
secure.setHostnameVerifier(config.getHostnameVerifier());
}
return urlConnection;
}
代码示例来源:origin: outbrain/ob1k
@Override
public URI getUri() throws URISyntaxException {
return ningResponse.getUri().toJavaNetURI();
}
代码示例来源:origin: com.ning/async-http-client
final URI wsURI = httpTxCtx.wsRequestURI.toJavaNetURI();
secure = "wss".equalsIgnoreCase(wsURI.getScheme());
httpTxCtx.protocolHandler = Version.RFC6455.createHandler(true);
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client
public ProxyServer select(Uri uri) {
try {
URI javaUri = uri.toJavaNetURI();
代码示例来源:origin: javaee/grizzly-ahc
public ProxyServer select(Uri uri) {
try {
URI javaUri = uri.toJavaNetURI();
代码示例来源:origin: javaee/grizzly-ahc
@Test(groups = {"standalone", "default_provider"})
public void testRawUrlQuery() throws UnsupportedEncodingException, URISyntaxException {
String preEncodedUrl = "http://example.com/space%20mirror.php?%3Bteile";
RequestBuilder rb = new RequestBuilder("GET", true).setUrl(preEncodedUrl);
Request request = rb.build();
assertEquals(request.getUrl(), preEncodedUrl);
assertEquals(request.getUri().toJavaNetURI().toString(), preEncodedUrl);
}
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client
final URI wsURI = httpTxCtx.wsRequestURI.toJavaNetURI();
secure = "wss".equalsIgnoreCase(wsURI.getScheme());
httpTxCtx.protocolHandler = Version.RFC6455.createHandler(true);
代码示例来源:origin: javaee/grizzly-ahc
final URI wsURI = httpTxCtx.wsRequestURI.toJavaNetURI();
secure = "wss".equalsIgnoreCase(wsURI.getScheme());
httpTxCtx.protocolHandler = Version.RFC6455.createHandler(true);
内容来源于网络,如有侵权,请联系作者删除!