0
server.User上のファイルを更新したいと思います。データを入力してファイルの内容を更新するリクエストをサーバーに送信できます。 。
angularJS code
$http.put("app/rest/updateMsg",fileContent)
Spring controller code
@RequestMapping(value = "/updateMsg", method = RequestMethod.PUT)
public ResponseEntity<Boolean> updateMsg(@RequestBody String fileContent){
//update file code
}
この問題の回避方法が見つかりました。空の場合( "")、明示的にfilecontentを ""に設定します。
他の解決方法はありますか?
レストコンベンションによれば、PUTのリクエストボディは常に存在する必要があります – nikjohn
[本文を含めるにはHTTP PUTリクエストが必要ですか?](http://stackoverflow.com/questions/1233372/) http-put-request-to-include-a-bodyである) – nikjohn