Skip to content

Instantly share code, notes, and snippets.

@nazartm
Created March 2, 2014 17:39
Show Gist options
  • Save nazartm/9310385 to your computer and use it in GitHub Desktop.
Save nazartm/9310385 to your computer and use it in GitHub Desktop.
@Consumes({"application/vnd.blog.v1+xml", "application/vnd.blog.v1+json"})
@Produces({"application/vnd.blog.v1+xml", "application/vnd.blog.v1+json"})
public interface BlogRestfulService {
@GET
@Path("/posts")
List<Post> getPosts();
@GET
@Path("/post/{id}")
Post getPost(@PathParam("id") int id);
@POST
@Path("/post")
Response addPost(Post post);
@PUT
@Path("/post/{id}")
Response updatePost(@PathParam("id") int id, Post post);
@DELETE
@Path("/post/{id}")
Response deletePost(@PathParam("id") int id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment