### Question:
HTTP { public static String postForm( final String url, final Map<String, ?> headers, final Map<String, Object> formData ) { return Exceptions.tryIt( String.class, new Exceptions.TrialWithReturn<String>() { @Override public String tryIt() throws Exception { URLConnection connection; connection = doPostFormData( url, headers, formData ); return extractResponseString( connection ); } } ); }  static String get(
            final String url ); static String post(
            final String url,
            final String body ); static Response getResponse(
            final String url ); static byte[] getBytes(
            final String url, final String contentType ); static byte[] getBytesWithHeaders(
            final String url, final String contentType, final Map<String, ?> headers ); static String getWithHeaders(
            final String url,
            final Map<String, ?> headers ); static String getWithContentType(
            final String url,
            final Map<String, ?> headers,
            final String contentType ); static String getWithCharSet(
            final String url,
            final Map<String, ?> headers,
            final String contentType,
            final String charSet ); static String postText(
            final String url,
            final String body ); static String postBodyTextWithContentType(
            final String url,
            final String contentType,
            final String body ); static String postJSON(
            final String url,
            final String jsonString ); static Response jsonRestCallViaPOST(
            final String url,
            final String jsonString ); static String getJSON(
            final String url,
            final Map<String, ?> headers
    ); static Response jsonRestCallWithHeaders(
            final String url,
            final Map<String, ?> headers
    ); static Response jsonRestCall(
            final String url
    ); static Response postBodyTextWithContentTypeReturnResponse(    final String url,
            final String contentType,
            final String body ); static String getJSONWithParams(
            final String url,
            final Map<String, ?> headers, final Map<String, ?> params
    ); static String postXML(
            final String url,
            final String jsonString ); static String postWithHeaders(
            final String url,
            final Map<String, ?> headers,
            final String body ); static String postWithContentType(
            final String url,
            final Map<String, ?> headers,
            final String contentType,
            final String body ); static String postWithCharset(
            final String url,
            final Map<String, ?> headers,
            final String contentType,
            final String charSet,
            final String body ); static String postForm( final String url, final Map<String, ?> headers,
                                   final Map<String, Object> formData
    ); static final int DEFAULT_TIMEOUT_SECONDS; static final String APPLICATION_JSON; }### Answer:
@Test public void testPostForm() throws Exception { HttpServer server = HttpServer.create( new InetSocketAddress( 9220 ), 0 ); server.createContext( "/test", new MyHandler() ); server.setExecutor( null ); server.start(); Thread.sleep( 10 ); String response = HTTP.postForm( "http: Collections.EMPTY_MAP, map( "hI", ( Object ) "hi-mom", "image", new byte[]{ 1, 2, 3 } ) ); boolean ok = true; ok |= response.startsWith( "hI=hi-mom&image=%01%02%03" ) || die( "encoding did not work --" + response + "--" ); Thread.sleep( 10 ); server.stop( 0 ); }