- Explain the basics of web services
- Exercise with a database
References
YouTube link :
https://www.youtube.com/playlist?list=PLtDIUAtyP4lhV7CsYfLuIx26UeG4J-ujZ
GitHub :
https://github.com/Ghadeerof
2. Intro 1
• REST is the acronymfor REpresentational State Transfer.
• REST is an architectural style for developing applications that can be accessed over the network.
• Restful Web Services is a statelessclient-server architecture where web services are resources and can
be identified by their URIs.
• REST Client applications can use HTTP GET/POSTmethods to invoke Restful web services.
• REST doesn’t specify any specificprotocol to use, but in almost all casesit’s used over HTTP/HTTPS.
• We can use XML, JSON, text or any other type of data for request and response.
3. Java RESTful Web Services API 2
• Java API for RESTful Web Services (JAX-RS) is the Java API for creating RESTweb services.
• JAX-RS uses annotations to simplifythe development and deployment of web services.
• JAX-RSis part of JDK, so you don’t needto include anything to use it’s annotations
4. Restful Web Services Annotations 3
Some of the importantJAX-RS annotations are:
• @Path: used to specify the relative path of classand methods. We can get the URI of a webservice
by scanning the Pathannotationvalue.
• @GET , @PUT , @POST , @DELETEand @HEAD: usedto specify the HTTPrequest type for a
method.
• @Produces , @Consumes : usedto specify therequest and responsetypes.
• @PathParam: used to bindthe method parameter to pathvalue by parsing it.