postに@produceをいれました
1 parent 3501697 commit 07b0789f19e7e9b8cf57e837be0a0a733ff71b34
d-matsuura authored on 14 May
Showing 1 changed file
View
4
src/main/java/org/ntlab/citrusserver/resources/BooksRest.java
}
 
@Path("/{account_id}/books")
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)//bodyに入力する値がある時
@Produces(MediaType.APPLICATION_JSON) // intとかstringとかがたくさん返ってくるから、json public voidじゃないときは、返さなあかんから、 @Produces(MediaType.APPLICATION_JSON) これがいる
@Consumes(MediaType.APPLICATION_FORM_URLENCODED) // bodyに入力する値がある時
public Book createBook(@PathParam("account_id") String account_id, @FormParam("title") String title, @FormParam("color") String color, @FormParam("publicity") Boolean publicity, @FormParam("token") String token) {
return bookManager.createBook(account_id, title, color, publicity, token);
}