RESTful Tutorial

Discuss RESTful Web Services

Discuss RESTful Web Services &-8211; this Article or News was published on this date:2019-05-12 12:16:05 kindly share it with friends if you find it helpful

Discuss RESTful Web Services


Advertisements


RESTful Web Services are basically REST Architecture based Web Services. In REST Architecture everything is a resource. RESTful web services are light weight, highly scalable and maintainable and are very commonly used to create APIs for web-based applications. This tutorial will teach you the basics of RESTful Web Services and contains chapters discussing all the basic components of RESTful Web Services with suitable examples.




Advertisements

RESTful &-8211; Home

RESTful &-8211; Introduction

RESTful &-8211; Environment Setup

RESTful &-8211; First Application

RESTful &-8211; Resources

RESTful &-8211; Messages

RESTful &-8211; Addressing

RESTful &-8211; Methods

RESTful &-8211; Statelessness

RESTful &-8211; Caching

RESTful &-8211; Security

RESTful &-8211; Java (JAX-RS)

RESTful &-8211; Questions and Answers

RESTful &-8211; Quick Guide

RESTful &-8211; Useful Resources

RESTful &-8211; Discussion

UPSC IAS Exams Notes

Developer&-8217;s Best Practices

Questions and Answers

Effective Resume Writing

HR Interview Questions

Computer Glossary

Who is Who

RESTful Web Services – Useful Resources

RESTful Web Services &-8211; Useful Resources &-8211; this Article or News was published on this date:2019-05-12 12:16:04 kindly share it with friends if you find it helpful

RESTful Web Services &-8211; Useful Resources


Advertisements


The following resources contain additional information on RESTful Web Services. Please use them to get more in-depth knowledge on this.

Useful Links on RESTful Web Services

Useful Books on RESTful Web Services

  • RESTful Web Services
  • Developing RESTful Services with JAX-RS 2.0, WebSockets, and JSON
  • Understanding RESTful Web Services
  • Java Web Services
  • RESTful Java Web Services
  • RESTful .NET

To enlist your site on this page, please drop an email to [email protected]



Advertisements

RESTful &-8211; Home

RESTful &-8211; Introduction

RESTful &-8211; Environment Setup

RESTful &-8211; First Application

RESTful &-8211; Resources

RESTful &-8211; Messages

RESTful &-8211; Addressing

RESTful &-8211; Methods

RESTful &-8211; Statelessness

RESTful &-8211; Caching

RESTful &-8211; Security

RESTful &-8211; Java (JAX-RS)

RESTful &-8211; Questions and Answers

RESTful &-8211; Quick Guide

RESTful &-8211; Useful Resources

RESTful &-8211; Discussion

UPSC IAS Exams Notes

Developer&-8217;s Best Practices

Questions and Answers

Effective Resume Writing

HR Interview Questions

Computer Glossary

Who is Who

RESTful Web Services – Security

RESTful Web Services &-8211; Security &-8211; this Article or News was published on this date:2019-05-12 12:16:03 kindly share it with friends if you find it helpful

RESTful Web Services &-8211; Security


Advertisements


As RESTful Web Services work with HTTP URL Paths, it is very important to safeguard a RESTful Web Service in the same manner as a website is secured.

Following are the best practices to be adhered to while designing a RESTful Web Service −

  • Validation − Validate all inputs on the server. Protect your server against SQL or NoSQL injection attacks.

  • Session Based Authentication − Use session based authentication to authenticate a user whenever a request is made to a Web Service method.

  • No Sensitive Data in the URL − Never use username, password or session token in a URL, these values should be passed to Web Service via the POST method.

  • Restriction on Method Execution − Allow restricted use of methods like GET, POST and DELETE methods. The GET method should not be able to delete data.

  • Validate Malformed XML/JSON − Check for well-formed input passed to a web service method.

  • Throw generic Error Messages − A web service method should use HTTP error messages like 403 to show access forbidden, etc.

HTTP Code

Sr.No. HTTP Code & Description

1

200

OK − shows success.

2

201

CREATED − when a resource is successfully created using POST or PUT request. Returns link to the newly created resource using the location header.

3

204

NO CONTENT − when response body is empty. For example, a DELETE request.

4

304

NOT MODIFIED − used to reduce network bandwidth usage in case of conditional GET requests. Response body should be empty. Headers should have date, location, etc.

5

400

BAD REQUEST − states that an invalid input is provided. For example, validation error, missing data.

6

401

UNAUTHORIZED − states that user is using invalid or wrong authentication token.

7

403

FORBIDDEN − states that the user is not having access to the method being used. For example, Delete access without admin rights.

8

404

NOT FOUND − states that the method is not available.

9

409

CONFLICT − states conflict situation while executing the method. For example, adding duplicate entry.

10

500

INTERNAL SERVER ERROR − states that the server has thrown some exception while executing the method.



Advertisements

RESTful &-8211; Home

RESTful &-8211; Introduction

RESTful &-8211; Environment Setup

RESTful &-8211; First Application

RESTful &-8211; Resources

RESTful &-8211; Messages

RESTful &-8211; Addressing

RESTful &-8211; Methods

RESTful &-8211; Statelessness

RESTful &-8211; Caching

RESTful &-8211; Security

RESTful &-8211; Java (JAX-RS)

RESTful &-8211; Questions and Answers

RESTful &-8211; Quick Guide

RESTful &-8211; Useful Resources

RESTful &-8211; Discussion

UPSC IAS Exams Notes

Developer&-8217;s Best Practices

Questions and Answers

Effective Resume Writing

HR Interview Questions

Computer Glossary

Who is Who

RESTful Web Services – Java (JAX-RS)

RESTful Web Services &-8211; Java (JAX-RS) &-8211; this Article or News was published on this date:2019-05-12 12:16:03 kindly share it with friends if you find it helpful

RESTful Web Services &-8211; Java (JAX-RS)


Advertisements


JAX-RS stands for JAVA API for RESTful Web Services. JAX-RS is a JAVA based programming language API and specification to provide support for created RESTful Web Services. Its 2.0 version was released on the 24th May 2013. JAX-RS uses annotations available from Java SE 5 to simplify the development of JAVA based web services creation and deployment. It also provides supports for creating clients for RESTful Web Services.

Specifications

Following are the most commonly used annotations to map a resource as a web service resource.

Sr.No. Annotation & Description

1

@Path

Relative path of the resource class/method.

2

@GET

HTTP Get request, used to fetch resource.

3

@PUT

HTTP PUT request, used to create resource.

4

@POST

HTTP POST request, used to create/update resource.

5

@DELETE

HTTP DELETE request, used to delete resource.

6

@HEAD

HTTP HEAD request, used to get status of method availability.

7

@Produces

States the HTTP Response generated by web service. For example, APPLICATION/XML, TEXT/HTML, APPLICATION/JSON etc.

8

@Consumes

States the HTTP Request type. For example, application/x-www-formurlencoded to accept form data in HTTP body during POST request.

9

@PathParam

Binds the parameter passed to the method to a value in path.

10

@QueryParam

Binds the parameter passed to method to a query parameter in the path.

11

@MatrixParam

Binds the parameter passed to the method to a HTTP matrix parameter in path.

12

@HeaderParam

Binds the parameter passed to the method to a HTTP header.

13

@CookieParam

Binds the parameter passed to the method to a Cookie.

14

@FormParam

Binds the parameter passed to the method to a form value.

15

@DefaultValue

Assigns a default value to a parameter passed to the method.

16

@Context

Context of the resource. For example, HTTPRequest as a context.

Note − We have used Jersey, a reference implementation of JAX-RS 2.0 by Oracle, in the RESTful Web Services &-8211; First Application and RESTful Web Services &-8211; Methods chapters.



Advertisements

RESTful &-8211; Home

RESTful &-8211; Introduction

RESTful &-8211; Environment Setup

RESTful &-8211; First Application

RESTful &-8211; Resources

RESTful &-8211; Messages

RESTful &-8211; Addressing

RESTful &-8211; Methods

RESTful &-8211; Statelessness

RESTful &-8211; Caching

RESTful &-8211; Security

RESTful &-8211; Java (JAX-RS)

RESTful &-8211; Questions and Answers

RESTful &-8211; Quick Guide

RESTful &-8211; Useful Resources

RESTful &-8211; Discussion

UPSC IAS Exams Notes

Developer&-8217;s Best Practices

Questions and Answers

Effective Resume Writing

HR Interview Questions

Computer Glossary

Who is Who

RESTful Questions and Answers

RESTful Questions and Answers &-8211; this Article or News was published on this date:2019-05-12 12:16:03 kindly share it with friends if you find it helpful

RESTful Questions and Answers


Advertisements


RESTful Questions and Answers has been designed with a special intention of helping students and professionals preparing for various Certification Exams and Job Interviews. This section provides a useful collection of sample Interview Questions and Multiple Choice Questions (MCQs) and their answers with appropriate explanations.

Questions and Answers

SN Question/Answers Type
1 RESTful Interview Questions

This section provides a huge collection of RESTful Interview Questions with their answers hidden in a box to challenge you to have a go at them before discovering the correct answer.

2 RESTful Online Quiz

This section provides a great collection of RESTful Multiple Choice Questions (MCQs) on a single page along with their correct answers and explanation. If you select the right option, it turns green; else red.

3 RESTful Online Test

If you are preparing to appear for a Java and RESTful Framework related certification exam, then this section is a must for you. This section simulates a real online test along with a given timer which challenges you to complete the test within a given time-frame. Finally you can check your overall test score and how you fared among millions of other candidates who attended this online test.

4 RESTful Mock Test

This section provides various mock tests that you can download at your local machine and solve offline. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.



Advertisements

RESTful &-8211; Home

RESTful &-8211; Introduction

RESTful &-8211; Environment Setup

RESTful &-8211; First Application

RESTful &-8211; Resources

RESTful &-8211; Messages

RESTful &-8211; Addressing

RESTful &-8211; Methods

RESTful &-8211; Statelessness

RESTful &-8211; Caching

RESTful &-8211; Security

RESTful &-8211; Java (JAX-RS)

RESTful &-8211; Questions and Answers

RESTful &-8211; Quick Guide

RESTful &-8211; Useful Resources

RESTful &-8211; Discussion

UPSC IAS Exams Notes

Developer&-8217;s Best Practices

Questions and Answers

Effective Resume Writing

HR Interview Questions

Computer Glossary

Who is Who