List of usage examples for io.netty.handler.codec.http HttpRequest getUri
@Deprecated String getUri();
From source file:com.rackspacecloud.blueflood.tracker.Tracker.java
License:Apache License
public void trackResponse(HttpRequest request, FullHttpResponse response) { // check if tenantId is being tracked by JMX TenantTrackerMBean and log the response if it is // HttpRequest is needed for original request uri and tenantId if (request == null) return;//w ww . j ava 2 s .c om if (response == null) return; String tenantId = findTid(request.getUri()); if (isTracking(tenantId)) { HttpResponseStatus status = response.getStatus(); String messageBody = response.content().toString(Constants.DEFAULT_CHARSET); // get parameters String queryParams = getQueryParameters(request); // get headers String headers = ""; for (String headerName : response.headers().names()) { headers += "\n" + headerName + "\t" + response.headers().get(headerName); } // get response content String responseContent = ""; if ((messageBody != null) && (!messageBody.isEmpty())) { responseContent = "\nRESPONSE_CONTENT:\n" + messageBody; } String logMessage = "[TRACKER] " + "Response for tenantId " + tenantId + " " + request.getMethod() + " request " + request.getUri() + queryParams + "\nRESPONSE_STATUS: " + status.code() + "\nRESPONSE HEADERS: " + headers + responseContent; log.info(logMessage); } }
From source file:com.seagate.kinetic.simulator.io.provider.nio.http.HttpMessageServiceHandler.java
License:Open Source License
@Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { int contentLength = 0; if (msg instanceof HttpRequest) { HttpRequest request = (HttpRequest) msg; logger.finest("protocol version: " + request.getProtocolVersion()); logger.finest("host: " + getHost(request, "unknown")); logger.finest("REQUEST_URI: " + request.getUri()); List<Map.Entry<String, String>> headers = request.headers().entries(); String lenstr = request.headers().get(HttpHeaders.Names.CONTENT_LENGTH); contentLength = Integer.parseInt(lenstr); logger.finest("content length=" + contentLength); if (!headers.isEmpty()) { for (Map.Entry<String, String> h : request.headers().entries()) { String key = h.getKey(); String value = h.getValue(); logger.finest("HEADER: " + key + " = " + value); }// w w w . j a va 2 s . c o m } QueryStringDecoder queryStringDecoder = new QueryStringDecoder(request.getUri()); Map<String, List<String>> params = queryStringDecoder.parameters(); if (!params.isEmpty()) { for (Entry<String, List<String>> p : params.entrySet()) { String key = p.getKey(); List<String> vals = p.getValue(); for (String val : vals) { logger.finest("PARAM: " + key + " = " + val); } } } } // create extended builder ExtendedMessage.Builder extendedMessage = ExtendedMessage.newBuilder(); if (msg instanceof HttpContent) { HttpContent httpContent = (HttpContent) msg; ByteBuf content = httpContent.content(); if (content.isReadable()) { byte[] body = new byte[contentLength]; content.getBytes(0, body); // read from serialized bytes extendedMessage.mergeFrom(body); } // build message ExtendedMessage extended = extendedMessage.build(); if (logger.isLoggable(Level.FINEST)) { logger.finest("received request: " + extended); } // create kinetic message for processing KineticMessage km = new KineticMessage(); // set interface message km.setMessage(extended.getInterfaceMessage()); // get command bytes ByteString commandBytes = extendedMessage.getInterfaceMessage().getCommandBytes(); // build command Command.Builder commandBuilder = Command.newBuilder(); try { commandBuilder.mergeFrom(commandBytes); km.setCommand(commandBuilder.build()); } catch (InvalidProtocolBufferException e) { logger.log(Level.WARNING, e.getMessage(), e); } // set value if (extended.hasValue()) { km.setValue(extended.getValue().toByteArray()); } // process request KineticMessage kmresp = this.lcservice.processRequest(km); // construct response message ExtendedMessage.Builder extendedResponse = ExtendedMessage.newBuilder(); // set interface message extendedResponse.setInterfaceMessage((Message.Builder) kmresp.getMessage()); // set value if (kmresp.getValue() != null) { extendedResponse.setValue(ByteString.copyFrom(kmresp.getValue())); } // get serialized value ByteBuf data = Unpooled.copiedBuffer(extendedResponse.build().toByteArray()); FullHttpResponse httpResponse = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, data); httpResponse.headers().set(CONTENT_TYPE, "application/octet-stream"); httpResponse.headers().set(HttpHeaders.Names.CONTENT_ENCODING, HttpHeaders.Values.BINARY); httpResponse.headers().set(CONTENT_LENGTH, httpResponse.content().readableBytes()); httpResponse.headers().set(CONNECTION, HttpHeaders.Values.KEEP_ALIVE); // send response message ctx.writeAndFlush(httpResponse); if (logger.isLoggable(Level.FINEST)) { logger.finest("wrote and flushed response: " + kmresp); } } }
From source file:com.springapp.mvc.netty.example.http.snoop.HttpSnoopServerHandler.java
License:Apache License
@Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) { if (msg instanceof HttpRequest) { HttpRequest request = this.request = (HttpRequest) msg; if (HttpHeaders.is100ContinueExpected(request)) { send100Continue(ctx);//from www .j ava 2s.com } buf.setLength(0); buf.append("WELCOME TO THE WILD WILD WEB SERVER\r\n"); buf.append("===================================\r\n"); buf.append("VERSION: ").append(request.getProtocolVersion()).append("\r\n"); buf.append("HOSTNAME: ").append(HttpHeaders.getHost(request, "unknown")).append("\r\n"); buf.append("REQUEST_URI: ").append(request.getUri()).append("\r\n\r\n"); HttpHeaders headers = request.headers(); if (!headers.isEmpty()) { for (Entry<String, String> h : headers) { String key = h.getKey(); String value = h.getValue(); buf.append("HEADER: ").append(key).append(" = ").append(value).append("\r\n"); } buf.append("\r\n"); } QueryStringDecoder queryStringDecoder = new QueryStringDecoder(request.getUri()); Map<String, List<String>> params = queryStringDecoder.parameters(); if (!params.isEmpty()) { for (Entry<String, List<String>> p : params.entrySet()) { String key = p.getKey(); List<String> vals = p.getValue(); for (String val : vals) { buf.append("PARAM: ").append(key).append(" = ").append(val).append("\r\n"); } } buf.append("\r\n"); } appendDecoderResult(buf, request); } if (msg instanceof HttpContent) { HttpContent httpContent = (HttpContent) msg; ByteBuf content = httpContent.content(); if (content.isReadable()) { buf.append("CONTENT: "); buf.append(content.toString(CharsetUtil.UTF_8)); buf.append("\r\n"); appendDecoderResult(buf, request); } if (msg instanceof LastHttpContent) { buf.append("END OF CONTENT\r\n"); LastHttpContent trailer = (LastHttpContent) msg; if (!trailer.trailingHeaders().isEmpty()) { buf.append("\r\n"); for (String name : trailer.trailingHeaders().names()) { for (String value : trailer.trailingHeaders().getAll(name)) { buf.append("TRAILING HEADER: "); buf.append(name).append(" = ").append(value).append("\r\n"); } } buf.append("\r\n"); } if (!writeResponse(trailer, ctx)) { // If keep-alive is off, close the connection once the content is fully written. ctx.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE); } } } }
From source file:com.stremebase.examples.todomvc.HttpRouter.java
License:Apache License
private static HttpResponse createResponse(HttpRequest req, Router<Integer> router) { RouteResult<Integer> routeResult = router.route(req.getMethod(), req.getUri()); Integer request = routeResult.target(); String data = ""; String mimeType = ""; if (request == CSS) { data = Todo.getCss();// w ww. j ava2s. c o m mimeType = "text/css"; } else if (request == ICON) { mimeType = "image/x-icon"; } else if (request == GET) { data = Todo.get(); mimeType = "text/html"; } else if (request == FILTER) { data = Todo.filter(routeResult.pathParams().get("filtertype")); mimeType = "text/html"; } else if (req.getMethod().equals(HttpMethod.POST)) { HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(new DefaultHttpDataFactory(false), req); Attribute attribute; String item_text = null; InterfaceHttpData httpData = decoder.getBodyHttpData("item-text"); if (httpData != null) { attribute = (Attribute) httpData; try { item_text = attribute.getValue(); } catch (IOException e) { e.printStackTrace(); } } String item_id = null; httpData = decoder.getBodyHttpData("item-id"); if (httpData != null) { attribute = (Attribute) httpData; try { item_id = attribute.getValue(); } catch (IOException e) { e.printStackTrace(); } } if (request == POST) { if (item_id == null) data = Todo.create(item_text); else data = Todo.save(Long.valueOf(item_id), item_text); } else if (request == DELETE) { data = Todo.delete(Long.valueOf(item_id)); } else if (request == DELETECOMPLETED) { data = Todo.clearCompleted(); } else if (request == TOGGLESTATUS) data = Todo.toggleStatus(Long.valueOf(item_id)); mimeType = "text/html"; decoder.destroy(); } FullHttpResponse res; if (request == NOTFOUND) { res = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.TEMPORARY_REDIRECT); res.headers().add(HttpHeaders.Names.LOCATION, "/"); return res; } if (request == ICON) res = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.copiedBuffer(Todo.favicon)); else res = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.copiedBuffer(data, CharsetUtil.UTF_8)); res.headers().set(HttpHeaders.Names.CONTENT_TYPE, mimeType); res.headers().set(HttpHeaders.Names.CONTENT_LENGTH, res.content().readableBytes()); if (request == CSS || request == ICON) setDateAndCacheHeaders(res); return res; }
From source file:com.topsec.bdc.platform.api.test.http.snoop.HttpSnoopServerHandler.java
License:Apache License
@Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) { if (msg instanceof HttpRequest) { HttpRequest request = this.request = (HttpRequest) msg; if (HttpHeaders.is100ContinueExpected(request)) { send100Continue(ctx);/*from w ww . j a v a 2s .c o m*/ } buf.setLength(0); buf.append("WELCOME TO THE WILD WILD WEB SERVER\r\n"); buf.append("===================================\r\n"); buf.append("VERSION: ").append(request.getProtocolVersion()).append("\r\n"); buf.append("HOSTNAME: ").append(HttpHeaders.getHost(request, "unknown")).append("\r\n"); buf.append("REQUEST_URI: ").append(request.getUri()).append("\r\n\r\n"); HttpHeaders headers = request.headers(); if (!headers.isEmpty()) { for (Map.Entry<String, String> h : headers) { String key = h.getKey(); String value = h.getValue(); buf.append("HEADER: ").append(key).append(" = ").append(value).append("\r\n"); } buf.append("\r\n"); } QueryStringDecoder queryStringDecoder = new QueryStringDecoder(request.getUri()); Map<String, List<String>> params = queryStringDecoder.parameters(); if (!params.isEmpty()) { for (Entry<String, List<String>> p : params.entrySet()) { String key = p.getKey(); List<String> vals = p.getValue(); for (String val : vals) { buf.append("PARAM: ").append(key).append(" = ").append(val).append("\r\n"); } } buf.append("\r\n"); } appendDecoderResult(buf, request); } if (msg instanceof HttpContent) { HttpContent httpContent = (HttpContent) msg; ByteBuf content = httpContent.content(); if (content.isReadable()) { buf.append("CONTENT: "); buf.append(content.toString(CharsetUtil.UTF_8)); buf.append("\r\n"); appendDecoderResult(buf, request); } if (msg instanceof LastHttpContent) { buf.append("END OF CONTENT\r\n"); LastHttpContent trailer = (LastHttpContent) msg; if (!trailer.trailingHeaders().isEmpty()) { buf.append("\r\n"); for (String name : trailer.trailingHeaders().names()) { for (String value : trailer.trailingHeaders().getAll(name)) { buf.append("TRAILING HEADER: "); buf.append(name).append(" = ").append(value).append("\r\n"); } } buf.append("\r\n"); } if (!writeResponse(trailer, ctx)) { // If keep-alive is off, close the connection once the content is fully written. ctx.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE); } } } }
From source file:com.topsec.bdc.platform.api.test.http.upload.HttpUploadServerHandler.java
License:Apache License
@Override public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception { if (msg instanceof HttpRequest) { HttpRequest request = this.request = (HttpRequest) msg; URI uri = new URI(request.getUri()); if (!uri.getPath().startsWith("/form")) { // Write Menu writeMenu(ctx);//from www . j a va2s.c om return; } responseContent.setLength(0); responseContent.append("WELCOME TO THE WILD WILD WEB SERVER\r\n"); responseContent.append("===================================\r\n"); responseContent.append("VERSION: " + request.getProtocolVersion().text() + "\r\n"); responseContent.append("REQUEST_URI: " + request.getUri() + "\r\n\r\n"); responseContent.append("\r\n\r\n"); // new getMethod for (Entry<String, String> entry : request.headers()) { responseContent.append("HEADER: " + entry.getKey() + '=' + entry.getValue() + "\r\n"); } responseContent.append("\r\n\r\n"); // new getMethod Set<Cookie> cookies; String value = request.headers().get(COOKIE); if (value == null) { cookies = Collections.emptySet(); } else { cookies = CookieDecoder.decode(value); } for (Cookie cookie : cookies) { responseContent.append("COOKIE: " + cookie + "\r\n"); } responseContent.append("\r\n\r\n"); QueryStringDecoder decoderQuery = new QueryStringDecoder(request.getUri()); Map<String, List<String>> uriAttributes = decoderQuery.parameters(); for (Entry<String, List<String>> attr : uriAttributes.entrySet()) { for (String attrVal : attr.getValue()) { responseContent.append("URI: " + attr.getKey() + '=' + attrVal + "\r\n"); } } responseContent.append("\r\n\r\n"); if (request.getMethod().equals(HttpMethod.GET)) { // GET Method: should not try to create a HttpPostRequestDecoder // So stop here responseContent.append("\r\n\r\nEND OF GET CONTENT\r\n"); // Not now: LastHttpContent will be sent writeResponse(ctx.channel()); return; } try { decoder = new HttpPostRequestDecoder(factory, request); } catch (ErrorDataDecoderException e1) { e1.printStackTrace(); responseContent.append(e1.getMessage()); writeResponse(ctx.channel()); ctx.channel().close(); return; } catch (IncompatibleDataDecoderException e1) { // GET Method: should not try to create a HttpPostRequestDecoder // So OK but stop here responseContent.append(e1.getMessage()); responseContent.append("\r\n\r\nEND OF GET CONTENT\r\n"); writeResponse(ctx.channel()); return; } readingChunks = HttpHeaders.isTransferEncodingChunked(request); responseContent.append("Is Chunked: " + readingChunks + "\r\n"); responseContent.append("IsMultipart: " + decoder.isMultipart() + "\r\n"); if (readingChunks) { // Chunk version responseContent.append("Chunks: "); readingChunks = true; } } // check if the decoder was constructed before // if not it handles the form get if (decoder != null) { if (msg instanceof HttpContent) { // New chunk is received HttpContent chunk = (HttpContent) msg; try { decoder.offer(chunk); } catch (ErrorDataDecoderException e1) { e1.printStackTrace(); responseContent.append(e1.getMessage()); writeResponse(ctx.channel()); ctx.channel().close(); return; } responseContent.append('o'); // example of reading chunk by chunk (minimize memory usage due to // Factory) readHttpDataChunkByChunk(); // example of reading only if at the end if (chunk instanceof LastHttpContent) { writeResponse(ctx.channel()); readingChunks = false; reset(); } } } else { writeResponse(ctx.channel()); } }
From source file:com.twitter.http2.HttpStreamEncoder.java
License:Apache License
private HttpHeadersFrame createHttpHeadersFrame(HttpRequest httpRequest) throws Exception { // Get the Stream-ID from the headers int streamId = HttpHeaders.getIntHeader(httpRequest, "X-SPDY-Stream-ID"); httpRequest.headers().remove("X-SPDY-Stream-ID"); // The Connection, Keep-Alive, Proxy-Connection, and Transfer-Encoding // headers are not valid and MUST not be sent. httpRequest.headers().remove(HttpHeaders.Names.CONNECTION); httpRequest.headers().remove("Keep-Alive"); httpRequest.headers().remove("Proxy-Connection"); httpRequest.headers().remove(HttpHeaders.Names.TRANSFER_ENCODING); HttpHeadersFrame httpHeadersFrame = new DefaultHttpHeadersFrame(streamId); // Unfold the first line of the request into name/value pairs httpHeadersFrame.headers().add(":method", httpRequest.getMethod().name()); httpHeadersFrame.headers().set(":scheme", "https"); httpHeadersFrame.headers().add(":path", httpRequest.getUri()); // Replace the HTTP host header with the SPDY host header String host = httpRequest.headers().get(HttpHeaders.Names.HOST); httpRequest.headers().remove(HttpHeaders.Names.HOST); httpHeadersFrame.headers().add(":authority", host); // Transfer the remaining HTTP headers for (Map.Entry<String, String> entry : httpRequest.headers()) { httpHeadersFrame.headers().add(entry.getKey(), entry.getValue()); }/*from w w w . ja v a 2 s. c o m*/ return httpHeadersFrame; }
From source file:com.xx_dev.apn.proxy.ApnProxyPreHandler.java
License:Apache License
private boolean preCheck(ChannelHandlerContext ctx, Object msg) { if (msg instanceof HttpRequest) { HttpRequest httpRequest = (HttpRequest) msg; String originalHost = HostNamePortUtil.getHostName(httpRequest); LoggerUtil.info(httpRestLogger, ctx.channel().remoteAddress().toString(), httpRequest.getMethod().name(), httpRequest.getUri(), httpRequest.getProtocolVersion().text(), httpRequest.headers().get(HttpHeaders.Names.USER_AGENT)); isPacRequest = false;//from w w w. j a v a2 s.c om // pac request if (StringUtils.equals(originalHost, ApnProxyConfig.getConfig().getPacHost())) { isPacRequest = true; String pacContent = null; if (ApnProxyConfig.getConfig().getListenType() == ApnProxyListenType.SSL) { pacContent = buildPacForSsl(); } else { pacContent = buildPacForPlain(); } ByteBuf pacResponseContent = Unpooled.copiedBuffer(pacContent, CharsetUtil.UTF_8); FullHttpMessage pacResponseMsg = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, pacResponseContent); HttpHeaders.setContentLength(pacResponseMsg, pacResponseContent.readableBytes()); HttpHeaders.setHeader(pacResponseMsg, "X-APN-PROXY-PAC", "OK"); HttpHeaders.setHeader(pacResponseMsg, "X-APN-PROXY-URL", "https://github.com/apn-proxy/apn-proxy"); HttpHeaders.setHeader(pacResponseMsg, "X-APN-PROXY-MSG", "We need more commiters!"); ctx.write(pacResponseMsg); ctx.flush(); return false; } // forbid request to proxy server internal network for (String forbiddenIp : forbiddenIps) { if (StringUtils.startsWith(originalHost, forbiddenIp)) { String errorMsg = "Forbidden"; ctx.write(HttpErrorUtil.buildHttpErrorMessage(HttpResponseStatus.FORBIDDEN, errorMsg)); ctx.flush(); return false; } } // forbid request to proxy server local if (StringUtils.equals(originalHost, "127.0.0.1") || StringUtils.equals(originalHost, "localhost")) { String errorMsg = "Forbidden Host"; ctx.write(HttpErrorUtil.buildHttpErrorMessage(HttpResponseStatus.FORBIDDEN, errorMsg)); ctx.flush(); return false; } // forbid reqeust to some port int originalPort = HostNamePortUtil.getPort(httpRequest); for (int fobiddenPort : forbiddenPorts) { if (originalPort == fobiddenPort) { String errorMsg = "Forbidden Port"; ctx.write(HttpErrorUtil.buildHttpErrorMessage(HttpResponseStatus.FORBIDDEN, errorMsg)); ctx.flush(); return false; } } } else { if (isPacRequest) { return false; } } return true; }
From source file:com.xx_dev.apn.proxy.ApnProxySchemaHandler.java
License:Apache License
@Override public void channelRead(ChannelHandlerContext uaChannelCtx, final Object msg) throws Exception { if (msg instanceof HttpRequest) { HttpRequest httpRequest = (HttpRequest) msg; String originalHost = HostNamePortUtil.getHostName(httpRequest); int originalPort = HostNamePortUtil.getPort(httpRequest); ApnProxyRemote apnProxyRemote = ApnProxyRemoteChooser.chooseRemoteAddr(originalHost, originalPort); Channel uaChannel = uaChannelCtx.channel(); ApnProxyConnectionAttribute apnProxyConnectionAttribute = ApnProxyConnectionAttribute.build( uaChannel.remoteAddress().toString(), httpRequest.getMethod().name(), httpRequest.getUri(), httpRequest.getProtocolVersion().text(), httpRequest.headers().get(HttpHeaders.Names.USER_AGENT), apnProxyRemote); uaChannelCtx.attr(ApnProxyConnectionAttribute.ATTRIBUTE_KEY).set(apnProxyConnectionAttribute); uaChannel.attr(ApnProxyConnectionAttribute.ATTRIBUTE_KEY).set(apnProxyConnectionAttribute); if (httpRequest.getMethod().equals(HttpMethod.CONNECT)) { if (uaChannelCtx.pipeline().get(ApnProxyUserAgentForwardHandler.HANDLER_NAME) != null) { uaChannelCtx.pipeline().remove(ApnProxyUserAgentForwardHandler.HANDLER_NAME); }//from w ww . j a va 2s . c o m if (uaChannelCtx.pipeline().get(ApnProxyUserAgentTunnelHandler.HANDLER_NAME) == null) { uaChannelCtx.pipeline().addLast(ApnProxyUserAgentTunnelHandler.HANDLER_NAME, new ApnProxyUserAgentTunnelHandler()); } } else { if (uaChannelCtx.pipeline().get(ApnProxyUserAgentForwardHandler.HANDLER_NAME) == null) { uaChannelCtx.pipeline().addLast(ApnProxyUserAgentForwardHandler.HANDLER_NAME, new ApnProxyUserAgentForwardHandler()); } } } LoggerUtil.debug(logger, uaChannelCtx.attr(ApnProxyConnectionAttribute.ATTRIBUTE_KEY), "UA msg", msg); uaChannelCtx.fireChannelRead(msg); }
From source file:com.xx_dev.apn.proxy.ApnProxyUserAgentForwardHandler.java
License:Apache License
private HttpRequest constructRequestForProxy(HttpRequest httpRequest, ApnProxyRemote apnProxyRemote) { String uri = httpRequest.getUri(); if (!apnProxyRemote.isAppleyRemoteRule()) { uri = this.getPartialUrl(uri); }//from ww w .java2 s . com HttpRequest _httpRequest = new DefaultHttpRequest(httpRequest.getProtocolVersion(), httpRequest.getMethod(), uri); Set<String> headerNames = httpRequest.headers().names(); for (String headerName : headerNames) { if (StringUtils.equalsIgnoreCase(headerName, "Proxy-Connection")) { continue; } if (StringUtils.equalsIgnoreCase(headerName, "Pragma")) { continue; } // if (StringUtils.equalsIgnoreCase(headerName, HttpHeaders.Names.CONNECTION)) { // continue; // } _httpRequest.headers().add(headerName, httpRequest.headers().getAll(headerName)); } _httpRequest.headers().set(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE); // _httpRequest.headers().set(HttpHeaders.Names.ACCEPT_ENCODING, HttpHeaders.Values.IDENTITY); if (StringUtils.isNotBlank(apnProxyRemote.getProxyUserName()) && StringUtils.isNotBlank(apnProxyRemote.getProxyPassword())) { String proxyAuthorization = apnProxyRemote.getProxyUserName() + ":" + apnProxyRemote.getProxyPassword(); try { _httpRequest.headers().set("Proxy-Authorization", "Basic " + Base64.encodeBase64String(proxyAuthorization.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { } } return _httpRequest; }