Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which of the following annotation of JAX RS A... Start Learning for Free
Which of the following annotation of JAX RS API is used to annotate a method used to create resource?
  • a)
    @Path
  • b)
    @GET
  • c)
    @PUT
  • d)
    @POST
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Which of the following annotation of JAX RS API is used to annotate a ...
Answer: C
Explanation: @PUT – HTTP Get request, used to create resource.
View all questions of this test
Most Upvoted Answer
Which of the following annotation of JAX RS API is used to annotate a ...
Understanding JAX-RS Annotations
JAX-RS (Java API for RESTful Web Services) is a set of APIs to create web services in Java. It utilizes annotations to define how requests and resources are handled.
Method for Creating Resources
In RESTful services, different HTTP methods correspond to different operations:
- @GET: Used to retrieve data from a server.
- @PUT: Typically used to update or replace an existing resource.
- @POST: Specifically designed to create a new resource on the server.
Why @POST is the Correct Choice
The annotation used to create a resource is @POST:
- Purpose: It signifies that a client is requesting the server to create a new resource, often submitting data in the request body.
- Usage: When the client sends a POST request, the server processes the data and usually creates a new instance of a resource. For example, submitting a new user registration.
- Response: The server usually returns a status code indicating success (e.g., 201 Created) along with a location header pointing to the newly created resource.
Conclusion
Thus, option 'C' (@POST) is the correct answer for annotating a method that creates a resource in a JAX-RS application, as it aligns with the RESTful principles of resource management.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Question Description
Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer?.
Solutions for Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer?, a detailed solution for Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer? has been provided alongside types of Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following annotation of JAX RS API is used to annotate a method used to create resource?a)@Pathb)@GETc)@PUTd)@POSTCorrect answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev