結論:実装は以下
@GetMapping(path = "/hoge", produces = "application/json")
public Response getSproItems(@Validated Request request,
@RequestHeader (value="User-Agent", required=false) String agent,
@RequestHeader("Cookie") String cookie)
return service.getResponse(request,agent,cookie)
}
リクエストURL
https://hoge.jp/hoge?query=apple&results=30&in_stock=true
クエリ:apple
件数:30
在庫有無:有
するとリクエストパラメータ(query=apple&results=30&in_stock=true)は
格納用のクラスに格納され、
リクエストヘッダーの情報は、string型として別で保管されます。
情報をリクエストURLに
含めたくないときは便利かもしれません。