Java high-level network programming
Qusay H. Mahmoud 2002-11-14 Border madman translation 2002-12-10
HTTP-based application
The classes and interfaces in the Java.NET package provide APIs available for low-level and high-level network programming. The low-level API allows you to access the network protocol directly, but you have to use low-level TCP sockets and UDP packets. High-level APIs (such as URL, URLCONNECTION and HTTPURLCONNECONNECTION, etc.) can make you more quickly develop web applications, but don't need to write a lot of code.
Another article, "NetWork Programming With J2se 1.4" will tell you how to use the low-level socket for network programming. The focus of this article is placed on how to develop HTTP-based applications in the high-level API in the Java.NET package.
This article will have the following:
Overview HTTP Overview Java.NET Package High-level API Example shows how to make an application for downloading stock markets to demonstrate how to submit data to web server overview HTTP authentication and show how to protect your network resource information instance presentation how to execute HTTP verification
Overview http
Hypertext Transfer Protocol, HTTP is a "request-response" application protocol. This protocol supports a fixed method such as GET, POST, PUT, DELETE, and so on. The GET method is generally requested to request resources to the server. Here are two examples of GET requests:
Get / http / 1.1
Get /Names.html http / 1.1
Alternatively, you can send data to the server using the GET and POST methods, which are different from the way data to the server:
GET method: The input data will send a POST method as part of the URL: Enter data as a separate entity
Consider the following HTML form: