Package org.asynchttpclient.uri

Examples of org.asynchttpclient.uri.Uri.toUrl()


            final int port = uri.getPort();
            requestPacket.setRequestURI(uri.getHost() + ':' + (port == -1 ? 443 : port));
        } else if ((secure || isWebSocket) && config.isUseRelativeURIsWithConnectProxies()) {
            requestPacket.setRequestURI(getNonEmptyPath(uri));
        } else {
            requestPacket.setRequestURI(uri.toUrl());
        }

        final BodyHandler bodyHandler = isPayloadAllowed(method) ?
                bodyHandlerFactory.getBodyHandler(request) :
                null;
View Full Code Here


                    httpTransactionContext.getLastRedirectURI());
        }
        httpTransactionContext.setLastRedirectURI(redirectURL);
        Request requestToSend;
        Uri uri = Uri.create(orig, redirectURL);
        if (!uri.toUrl().equalsIgnoreCase(orig.toUrl())) {
            requestToSend = EventHandler.newRequest(uri, responsePacket, httpTransactionContext,
                    sendAsGet(responsePacket, httpTransactionContext));
        } else {
            httpTransactionContext.setStatusHandler(null);
            httpTransactionContext.setInvocationStatus(CONTINUE);
View Full Code Here

        if (realm.isTargetProxy()) {
            return "/";
        } else {
            Uri uri = realm.getUri();
            if (realm.isUseAbsoluteURI()) {
                return realm.isOmitQuery() && MiscUtils.isNonEmpty(uri.getQuery()) ? uri.withNewQuery(null).toUrl() : uri.toUrl();
            } else {
                String path = getNonEmptyPath(uri);
                return realm.isOmitQuery() || !MiscUtils.isNonEmpty(uri.getQuery()) ? path : path + "?" + uri.getQuery();
            }
        }
View Full Code Here

                    // in case of a redirect from HTTP to HTTPS, future attributes might change
                    final boolean initialConnectionKeepAlive = future.isKeepAlive();
                    final String initialPoolKey = channelManager.getPartitionId(future);

                    future.setUri(uri);
                    String newUrl = uri.toUrl();
                    if (request.getUri().getScheme().startsWith(WEBSOCKET)) {
                        newUrl = newUrl.replaceFirst(HTTP, WEBSOCKET);
                    }

                    logger.debug("Redirecting to {}", newUrl);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.