String url = "https://localhost:8080/api/V1/hr/Auth";
HttpClient client = httpClientFactory.getHttpClient();
HttpPost request = new HttpPost(url);
request.addHeader("content-type", "application/json");
request.addHeader("clientUniqueId", "");
request.addHeader("language", "English");
jsonObject.put("UserName", "");
jsonObject.put("Password", "");
StringEntity params = new StringEntity(jsonObject.toString());
request.setEntity(params);
HttpResponse response;
response = client.execute(request);
String responseAsString = EntityUtils.toString(response.getEntity());
I need to replace the httpClient with WebClient I have used webflux dependency. And tried
HttpRequest request1 = (HttpRequest) webClientBuilder
.build()
.post()
.uri(url)
.header("content-type", "application/json")
.header("clientUniqueId", "")
.header("language", "English");
Thanks in advance.