SpringBoot 1.2.6 を使用して SpringREST API を作成しました。以下は私の投稿方法であり、機能します。しかし、Put メソッドを作成すると、機能しません。パラメータでデータを取得していません。
@CrossOrigin
@RequestMapping(
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE)
public String createArticle(String article_name, String article_content, Long image_id, String category,
HttpServletRequest req, Authentication authentication) throws Exception {...}
PUT METHOD // 記事の編集
@RequestMapping(value = "/{article_id}",
method = RequestMethod.PUT,
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE)
public String editArticle(@PathVariable("article_id") Long article_id,
String article_name, String article_content, String category, HttpServletRequest req) throws Exception {...}
デバッガーを設定しました。以下はデバッグ スナップショットの デバッグ イメージです。