Java Reference
In-Depth Information
HTTP/1.1 is the version of the protocol. Host , User-Agent , Accept , Accept-Language , and
Accept-Encoding are all message headers. There is no request body, as we are querying in-
formation from the server.
The response message from the server is very similar. It contains the version of HTTP we are
using, a response code, a short message that explains the response code, a variable set of op-
tional headers, and an optional message body. Here's the message the server might respond
with using the previous GET query:
HTTP / 1.1 200 OK
X - Powered - By: Servlet 2.4 ; JBoss - 4.2 . 2 . GA
Content - Type: text / html
< head >
< title > JBoss RESTEasy Project </ title >
</ head >
< body >
< h1 > JBoss RESTEasy </ h1 >
< p > JBoss RESTEasy is an open source implementation of the JAX - RS specification ...
The response code of this message is 200, and the status message is “OK.” This code means
that the request was processed successfully and that the client is receiving the information it
requested. HTTP has a large set of response codes. They can be informational codes like
200, “OK,” or error codes like 500, “Internal Server Error.” Visit the w3c's website for a
more complete and verbose listing of these codes.
This response message also has a message body that is a chunk of HTML. We know it is
HTML by the Content-Type header.
RESTful Architectural Principles
Roy Fielding's PhD thesis describing REST was really an explanation of why the human-
readable Web had become so pervasive in the past 18 years. As time went on, though, pro-
grammers started to realize that they could use the concepts of REST to build distributed ser-
vices and model service-oriented architectures (SOAs).
The idea of SOA is that application developers design their systems as a set of reusable, de-
coupled, distributed services. Since these services are published on the network, conceptu-
ally, it should be easier to compose larger and more complex systems. SOA has been around
for a long time. Developers have used technologies like DCE, CORBA, and Java RMI to
build them in the past. Nowadays, though, when you think of SOA, you think of SOAP-
based web services.
Search WWH ::




Custom Search