HttpClient { public HttpInvokeResult post(String addr, String uri, Collection<Pair<String, ?>> parameters, long timeoutMillis) { return post(addr, uri, null, parameters, timeoutMillis); } HttpClient(); void start(); void shutdown(); static SocketAddress string2SocketAddress(final String addr); static String parseChannelRemoteAddr(final Channel channel); static void closeChannel(Channel channel); void closeChannel(final String addr, final Channel channel); void processResponseMsg(ChannelHandlerContext ctx, HttpResponse msg); HttpInvokeResult get(String addr, String uri, long timeoutMillis); HttpInvokeResult get(String addr, String uri, Collection<Pair<String, ?>> headers, long timeoutMillis); HttpInvokeResult post(String addr, String uri, Collection<Pair<String, ?>> parameters, long timeoutMillis); HttpInvokeResult post(String addr, String uri, Collection<Pair<String, ?>> headers,
			Collection<Pair<String, ?>> parameters, long timeoutMillis); HttpInvokeResult invokeSync(final String addr, final HttpRequest request, final long timeoutMillis); HttpInvokeResult invokeSyncImpl(final Channel channel, final HttpRequest request, final long timeoutMillis);  }
@Test public void testPost() throws Exception { final String host = "config.ixiaopu.com"; final int port = 54321; Collection<Pair<String, ?>> parameters = new ArrayList<Pair<String, ?>>(); parameters.add(Pair.of(Constants.PROBE_MODIFY_REQUEST, "MEMCACHEDXIANGQU3e433623c8761a1903e2882afd52377c")); final HttpInvokeResult result = this.httpClient.post(host + ":" + port, "/config.co", parameters, 5000); System.out.println(result); final String content = result.getResponseBodyAsString(); System.out.println(content); }