Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>imho: <a href="http://hc.apache.org/httpclient-3.x/" rel="noreferrer">Apache HTTP Client</a></p> <p>usage example:</p> <pre><code>import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.*; import org.apache.commons.httpclient.params.HttpMethodParams; import java.io.*; public class HttpClientTutorial { private static String url = "http://www.apache.org/"; public static void main(String[] args) { // Create an instance of HttpClient. HttpClient client = new HttpClient(); // Create a method instance. GetMethod method = new GetMethod(url); // Provide custom retry handler is necessary method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(3, false)); try { // Execute the method. int statusCode = client.executeMethod(method); if (statusCode != HttpStatus.SC_OK) { System.err.println("Method failed: " + method.getStatusLine()); } // Read the response body. byte[] responseBody = method.getResponseBody(); // Deal with the response. // Use caution: ensure correct character encoding and is not binary data System.out.println(new String(responseBody)); } catch (HttpException e) { System.err.println("Fatal protocol violation: " + e.getMessage()); e.printStackTrace(); } catch (IOException e) { System.err.println("Fatal transport error: " + e.getMessage()); e.printStackTrace(); } finally { // Release the connection. method.releaseConnection(); } } } </code></pre> <p>some highlight features:</p> <ul> <li>Standards based, pure Java, implementation of HTTP versions 1.0 and 1.1 <ul> <li>Full implementation of all HTTP methods (GET, POST, PUT, DELETE, HEAD, OPTIONS, and TRACE) in an extensible OO framework.</li> <li>Supports encryption with HTTPS (HTTP over SSL) protocol.</li> <li>Granular non-standards configuration and tracking.</li> <li>Transparent connections through HTTP proxies.</li> <li>Tunneled HTTPS connections through HTTP proxies, via the CONNECT method.</li> <li>Transparent connections through SOCKS proxies (version 4 &amp; 5) using native Java socket support.</li> <li>Authentication using Basic, Digest and the encrypting NTLM (NT Lan Manager) methods.</li> <li>Plug-in mechanism for custom authentication methods.</li> <li>Multi-Part form POST for uploading large files.</li> <li>Pluggable secure sockets implementations, making it easier to use third party solutions</li> <li>Connection management support for use in multi-threaded applications. Supports setting the maximum total connections as well as the maximum connections per host. Detects and closes stale connections.</li> <li>Automatic Cookie handling for reading Set-Cookie: headers from the server and sending them back out in a Cookie: header when appropriate.</li> <li>Plug-in mechanism for custom cookie policies.</li> <li>Request output streams to avoid buffering any content body by streaming directly to the socket to the server.</li> <li>Response input streams to efficiently read the response body by streaming directly from the socket to the server.</li> <li>Persistent connections using KeepAlive in HTTP/1.0 and persistance in HTTP/1.1</li> <li>Direct access to the response code and headers sent by the server.</li> <li>The ability to set connection timeouts.</li> <li>HttpMethods implement the Command Pattern to allow for parallel requests and efficient re-use of connections.</li> <li>Source code is freely available under the Apache Software License.</li> </ul></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload