Currently, I am using the below java code. Here, I am passing parameters in the url.
RequestBody jsonRequestBody = RequestBody.create(mediaType, jsonBody.toString());
Request request = new Request.Builder()
.url("http://x.x.x.x:8080/v1/m?identifier=" + identifier)
.addHeader("claim", claim)
.post(jsonRequestBody)
.build();
Response response = client.newCall(request).execute();`
The problem is that my spring boot api has '@RequestBody Class obj' and '@RequestParam identifier' as the parameters. As obj is the object of class 'Class', the passed request body will be automatically converted to the respective obj(implementing serializable). I don't want to pass query parameters in the request body; rather I want to pass it separately.
I am unable to pass post parameters as well as request body separately using OkHttp. I tried looking up various resources but no luck. Can anyone help me out with this?