- Docs
- NetworkInterface
Represent a network interface of the local device. The class provides methods to get all information about the available interfaces of the systems, such as hardware address, display name, mtu, etc.
- Address
Related classes/interfaces
- InetAddress
- SocketAddress
- InetSocketAddress
InetAddress -> InetSocketAddress -> SocketAddress
- InetAddressUtils
- Socket
- Socket
- ServerSocket
- DatagramSocket
- MulticastSocket
Send/Receive long/int/short data:
- DataInputStream
- DataOutputStream
- xxx
Non-block socket
(Sample: )
- SocketChannel
- ServerSocketChannel
- URL
URL: Uniform Resource Locator (统一资源定位符)
URI: Uniform Resrouce Identifier (统一资源标识符)
- URLConnection
A connection to a URL for reading or writing.Built-in Protocols:
URL --getConnection--> URLConnection --setXXX--getInputStream/getOutputStream--> InputStream/OutputStream
- HttpURLConnection
- HttpsURLConnection
- JarURLConnection
- DownloadManager
Request to download an URI to a particular destination file in background, and will get notification once the URI is downloaded.
- xxx
Encode/Decode
- URLEncoder
- URLDecoder
- EncodingUtils
- Apach Library
- Params/Headers
Params
=====================================================================
Params represents a collection of HTTP protocol and framework parameters.
From HttpMessage.getParams().
Classes/Interfaces related to params:
- HttpParams
- HttpConnectionParams
Invoke methods of this class to set params into HttpParams, such as: set socket buffer size, connection time out, retriving data time out, etc.
- HttpProtocolParams
Headers of HTTP specific.
BasicHttpParams, DefaultedHttpParams.
- xxx
Headers
=====================================================================
Each header field consists of a name followed by a colon (\":\") and the field value. Field names are case-insensitive. he field value MAY be preceded by any amount of LWS, though a single SP is preferred.
Header is from HttpMessage.getXXXHeaders();
Classes/interfaces related to header:
- Header
- BasicHeader
- BufferedHeader
Represents a raw HTTP header whose content is parsed \'on demand\' only when the header value needs to be consumed.
- FormattedHeader
An HTTP header which is already formatted. For example when headers are received, the original formatting can be preserved. This allows for the header to be sent without another formatting step.
- xxx
Header Elements
=====================================================================
Header element is a specific type of value of HTTP header, such value can be decomposed into multiple elements (ie. the set-cookie header:
Set-Cookie: =[; =]...
[; expires=][; domain=]
[; path=][; secure][; httponly]
(from: %28v=vs.85%29.aspx))
Header elements is from Header.getElements().
Classes/Interface related to Header elements:
- HeaderElement
- BasicHeaderElement
Attribute/value pair
=====================================================================
From HeaderElement.getParametersXXX(), you can infoke getName/getValue with Attribute/value pair.
Related classes/interfaces:
- NameValuePair
- BasicNameValuePair
Request Line
=====================================================================
The first line of an HttpRequest. It contains the method, URI, and HTTP version of the request.
Classes/Interfaces:
- RequestLine
- BasicRequestLine
Status
=====================================================================
From HttpResponse.getStatusLine().
Status contains:
- Protocol version: HTTP/1.0, HTTP/1.1 etc.
- Status code (Defined in the class HttpStatus)
- Reason phrase
- xxx
Related classes/interfaces:
- StatusLine
Represents a status line as returned from a HTTP server.
- BasicStatusLine
Used to construct a status line.
- HttpStatus
Defines HTTP status codes.
- xxx
Version
=====================================================================
From HttpMessage.getProtocolVersion(), StatusLine.getProtocolVersion().
Http version contains (ie HTTP/1.0):
- Protocol: ie HTTP
- Major version: ie 1
- Minor version: ie 0
- xxx
Related classes/interfaces:
- ProtocolVersion
- HttpVersion
Defines HTTP protocol name; defines HTTP version 0.9, 1.0, 1.1; Use major and minor version to construct ProtocolVersion.
- xxx
- Message
Http Message
=====================================================================
Related classes/interfaces:
Request
=====================================================================
Classes/Interfaces:
- HttpRequest
- BasicHttpRequest
- HttpEntityEnclosingRequest
Basic implementation of a request with an entity that can be modified.
- BasicHttpEntityEnclosingRequest
- HttpUriRequest
- HttpRequestBase
- HttpGet: Download data/file (use getEntity to get data)
- HttpPut: Upload data/file (use setEntity to set data)
- HttpPost
- HttpDelete
- HttpTrace
- xxx
Constants related to the HTTP protocol is defined in the classes HTTP.
Response
=====================================================================
HttpResponse = HttpClient.execute(HttpRequest);
Related classes/interfaces
- HttpResponse/BasicHttpResponse
- xxx
Entity
=====================================================================
An entity that can be sent or received with an HTTP message, it the contents (data different fromhttp headers). An entity is the optional content of a message. If you need to send an entity, you can provide it for example as a byte array, string, file, or through an arbitrary input stream. If you receive a message with an entity, you typically get that as a basic entity. Entity implementations can be wrapped, for example to buffer the content in memory.
HttpEntity is got by invoking HttpEntityEnclosingRequest.getEntity or HttpResponse.getEntity, or set by invoking HttpGet.setEntity().
Various kinds of Entify: http://developer.android.com/reference/org/apache/http/entity/package-summary.html, you can use these classes to construct Entity.
- BasicHttpEntity
- BufferedHttpEntity
- ByteArrayEntity
- EntityTemplate
- FileEntity
- InputStreamEntity
- SerializableEntity
- StringEntity
- HttpEntityWrapper
- xxx
Another classes related to Entity:
- Client
HTTP clients encapsulate a smorgasbord of objects required to execute HTTP requests.
Related classes/interfaces:
- HttpClient
- DefaultHttpClient
Other classes to send http request:
- Others Classes
- Host
- HttpHost
hold remote host name, port and scheme.
- xxx
- Date
- HttpDateGenerator
- Buffer
A resizable byte/char array:
- ByteArrayBuffer
- CharArrayBuffer
- Constant
- HTTP
Constants related to the HTTP protocol
- xxx
- Send/Receive long/int/short data
- DataInputStream
- DataOutputStream
- xxx
- xxx
- Sample
HttpParams httpParams = new BasicHttpParams();
httpParams.setParameters(xxx);
HttpConnectionParams.setXXX(httpParams, xxx);
HttpClient httpClient = new DefaultHttpClient(httpParams);
HttpRequest httpRequest = HttpGet(xxx); //Or call HttpPut/HttpPost;
//Optional code begin
HttpEntity httpEntity = new StringHttpEntity(xxxx); //will upload data
httpRequest .setEntity(httpEntity); //httpRequest must be type of HttpPost
//Optional code end
HttpResponse httpResponse = httpClient.execute(httpRequest);
if (httpResponse.getStatusLine().getStatusCode() == 200)
{
String strResult = EntityUtils.toString(httpResponse.getEntity());
//InputStream is = httpResponse.getEntity().getContents();
}
- xxx
- SSL
Refer to the package 'javax.net.ssl'.
- SSLSocket
- SSLServerSocket
- xxx
阅读(1341) | 评论(0) | 转发(0) |