Last active
August 29, 2015 14:16
-
-
Save abhirockzz/9dd8773d21cc34ec6eaf to your computer and use it in GitHub Desktop.
A hypothetical resource of books
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("books") | |
public class Books{ | |
@Produces("application/json") | |
@GET | |
public List<Book> findAll(){ | |
//find all books | |
} | |
@Produces("application/json") | |
@GET | |
@Path("{id}") | |
public Book findById(@PathParam("id") String bookId){ | |
//find book by id e.g. /books/123 | |
} | |
@Produces("application/json") | |
@GET | |
public Book findByISBN(@QueryParam("isbn") String bookISBN){ | |
//find book by ISBN e.g. /books?isbn=xyz | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment