ここで私はSpringControlクラスでrest web service
のこのコードを書いています。ここで私はURLにアクセスしようとした方法をSpring Webサービスエラー:406受け入れられません
@RequestMapping(value="/someurl/{prm_passPhraseCode}/{prm_email}", method= RequestMethod.POST)
public @ResponseBody User sendResetLink(@PathVariable("prm_passPhraseCode") String prm_sPassPhrase, @PathVariable("prm_email") String prm_sEmail , HttpServletRequest prm_ObjRequest, HttpServletResponse prm_ObjResponse){
......
..... //some more logical Code.
return new User(); //just dummy object for reference.
}
- :後私はRestful-Client
RestServiceコードを使用して、このservice
を使用しようとするプロジェクトをビルドします。メソッドのタイプをpost
と選択しました。 は、私はまた、2つのヘッダAccept : application/json
URL http://127.0.0.1:8080/webservice.staff.backend/someurl/23812397997713/[email protected]
Content-Type : application/json
-
すべての私の他のRESTサービスのURLは、それが
GET
または
POST
が正常に動作しているされてのいずれかが追加されました。 私も
method = RequestMethod.GET
を変更してみましたが、同じエラーが表示されます。
エラー: -
Status Code 406 : The resource identified by this request is only capable of
generating responses with characteristics not acceptable according to the request "accept" headers.
いずれかのアイデアを持っている場合、助けてください。
が欠落している、これを試してみてくださいsendResetPasswordLinkが要求マッピングに反映されていないようです – Benchik
あなたは何を反映していないのですか? @ Benchik –
like @RequestMapping(値= "/ someurl/sendResetPasswordLink/{prm_passPhraseCode}/{prm_email}" – Benchik