Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

HTTPClient.doc.* (1)HTTPClient.http.* (1)HTTPClient.https.* (2)HTTPClient.shttp.* (1)

HTTPClient: Javadoc index of package HTTPClient.


Package Samples:

HTTPClient.doc
HTTPClient.http
HTTPClient.https
HTTPClient.shttp

Classes:

HTTPConnection: This class implements http protocol requests; it contains most of HTTP/1.1 and ought to be unconditionally compliant. Redirections are automatically handled, and authorizations requests are recognized and dealt with via an authorization handler. Only full HTTP/1.0 and HTTP/1.1 requests are generated. HTTP/1.1, HTTP/1.0 and HTTP/0.9 responses are recognized. Using the HTTPClient should be quite simple. First add the import statement ' import HTTPClient.*; ' to your file(s). Request can then be sent using one of the methods Head() , Get() , Post() , etc in HTTPConnection . These methods all return ...
HttpOutputStream: This class provides an output stream for requests. The stream must first be associated with a request before it may be used; this is done by passing it to one of the request methods in HTTPConnection. Example: OutputStream out = new HttpOutputStream(12345); rsp = con.Post("/cgi-bin/my_cgi", out); out.write(...); out.close(); if (rsp.getStatusCode() >= 300) ... There are two constructors for this class, one taking a length parameter, and one without any parameters. If the stream is created with a length then the request will be sent with the corresponding Content-length header and anything written ...
HTTPClientModule: This is the interface that a module must implement. There are two parts during a request: the construction of the request, and the handling of the response. A request may cycle through these parts multiple times when a module generates additional subrequests (such as a redirection status handling module might do). In the first step the request handler is invoked; here the headers, the request-uri, etc. can be modified, or a complete response can be generated. Then, if no response was generated, the request is sent over the wire. In the second step the response handlers are invoked. These may modify ...
AuthorizationInfo: Holds the information for an authorization response. There are 7 fields which make up this class: host, port, scheme, realm, cookie, params, and extra_info. The host and port select which server the info will be sent to. The realm is server specified string which groups various URLs under a given server together and which is used to select the correct info when a server issues an auth challenge; for schemes which don't use a realm (such as "NTLM", "PEM", and "Kerberos") the realm must be the empty string (""). The scheme is the authorization scheme used (such as "Basic" or "Digest"). There are ...
HttpURLConnection: This class is a wrapper around HTTPConnection providing the interface defined by java.net.URLConnection and java.net.HttpURLConnection. This class can be used to replace the HttpClient in the JDK with this HTTPClient by defining the property java.protocol.handler.pkgs=HTTPClient . One difference between Sun's HttpClient and this one is that this one will provide you with a real output stream if possible. This leads to two changes: you should set the request property "Content-Length", if possible, before invoking getOutputStream(); and in many cases getOutputStream() implies connect(). This should ...
CookieModule: This module handles Netscape cookies (also called Version 0 cookies) and Version 1 cookies. Specifically is reads the Set-Cookie and Set-Cookie2 response headers and sets the Cookie and Cookie2 headers as neccessary. The accepting and sending of cookies is controlled by a CookiePolicyHandler . This allows you to fine tune your privacy preferences. A cookie is only added to the cookie list if the handler allows it, and a cookie from the cookie list is only sent if the handler allows it. A cookie jar can be used to store cookies between sessions. This file is read when this class is loaded and is ...
URI: This class represents a generic URI, as defined in RFC-2396. This is similar to java.net.URL, with the following enhancements: it doesn't require a URLStreamhandler to exist for the scheme; this allows this class to be used to hold any URI, construct absolute URIs from relative ones, etc. it handles escapes correctly equals() works correctly relative URIs are correctly constructed it has methods for accessing various fields such as userinfo, fragment, params, etc. it handles less common forms of resources such as the "*" used in http URLs. Ideally, java.net.URL should subclass URI.
IdempotentSequence: This class checks whether a sequence of requests is idempotent. This is used to determine which requests may be automatically retried. This class also serves as a central place to record which methods have side effects and which methods are idempotent. Note: unknown methods (i.e. a method which is not HEAD, GET, POST, PUT, DELETE, OPTIONS or TRACE) are treated conservatively, meaning they are assumed to have side effects and are not idempotent. Usage: IdempotentSequence seq = new IdempotentSequence(); seq.add(r1); ... if (seq.isIdempotent(r1)) ... ...
RetryModule: This module handles request retries when a connection closes prematurely. It is triggered by the RetryException thrown by the StreamDemultiplexor. This module is somewhat unique in that it doesn't strictly limit itself to the HTTPClientModule interface and its return values. That is, it sends request directly using the HTTPConnection.sendRequest() method. This is necessary because this module will not only resend its request but it also resend all other requests in the chain. Also, it rethrows the RetryException in Phase1 to restart the processing of the modules.
SocksClient: This class implements a SOCKS Client. Supports both versions 4 and 5. GSSAPI however is not yet implemented. Usage is as follows: somewhere in the initialization code (and before the first socket creation call) create a SocksClient instance. Then replace each socket creation call sock = new Socket(host, port); with sock = socks_client.getSocket(host, port); (where socks_client is the above created SocksClient instance). That's all.
ContentMD5Module: This module handles the Content-MD5 response header. If this header was sent with a response and the entity isn't encoded using an unknown transport encoding then an MD5InputStream is wrapped around the response input stream. The MD5InputStream keeps a running digest and checks this against the expected digest from the Content-MD5 header the stream is closed. An IOException is thrown at that point if the digests don't match.
CIString: This class' raison d'etre is that I want to use a Hashtable using Strings as keys and I want the lookup be case insensitive, but I also want to be able retrieve the keys with original case (otherwise I could just use toLowerCase() in the get() and put()). Since the class String is final we create a new class that holds the string and overrides the methods hashCode() and equals().
AuthorizationHandler: This is the interface that an Authorization handler must implement. You can implement your own auth handler to add support for auth schemes other than the ones handled by the default handler, to use a different UI for soliciting usernames and passwords, or for using an altogether different way of getting the necessary auth info.
DefaultAuthHandler: A simple authorization handler that throws up a message box requesting both a username and password. This is default authorization handler. Currently only handles the authentication types "Basic", "Digest" and "SOCKS5" (used for the SocksClient and not part of HTTP per se).
UncompressInputStream: This class decompresses an input stream containing data compressed with the unix "compress" utility (LZC, a LZW variant). This code is based heavily on the unlzw.c code in gzip-1.2.4 (written by Peter Jannesen) and the original compress code.
AuthorizationModule: This module handles authentication requests. Authentication info is preemptively sent if any suitable candidate info is available. If a request returns with an appropriate status (401 or 407) then the necessary info is sought from the AuthenticationInfo class.
ExtBufferedInputStream: This class is a modified copy of java.io.BufferedInputStream which fixes the problem in fill when an InterrupedIOException occurs and which extends the class to allow searching for a string in the internal buffer (used for multipart content-types).
Cookie2: This class represents an http cookie as specified in the HTTP State Management Mechanism spec (also known as a version 1 cookie).
FilenameMangler: HTTPClient.Codecs.mpFormDataDecode() and HTTPClient.Codecs.mpFormDataEncode() may be handed class which implements this interface in order to control names of the decoded files or the names sent in the encoded data.
MD5InputStream: This class calculates a running md5 digest of the data read. When the stream is closed the calculated digest is passed to a HashVerifier which is expected to verify this digest and to throw an Exception if it fails.
HTTPResponse: This defines the http-response class returned by the requests. It's basically a wrapper around the Response class which first lets all the modules handle the response before finally giving the info to the user.
Handler: This class implements a URLStreamHandler for https URLs. With this you can use the HTTPClient package as a replacement for the JDKs client. To do so define the property java.protocol.handler.pkgs=HTTPClient .
Handler: This class implements a URLStreamHandler for shttp URLs. With this you can use the HTTPClient package as a replacement for the JDKs client. To do so define the property java.protocol.handler.pkgs=HTTPClient .
Handler: This class implements a URLStreamHandler for http URLs. With this you can use the HTTPClient package as a replacement for the JDKs client. To do so define the property java.protocol.handler.pkgs=HTTPClient .

Home | Contact Us | Privacy Policy | Terms of Service