I have the following uri
www.xyz.com - base uri I need to add userId to end of the uri as path parameter.
As per swagger document the uri format is www.example.com/{userId}
Parameter type = Path ,Value = userId(String)
I could add body to the post request. However I am not able to add userId as path parameter. I was only able to add the parameter is query parameter but have difficulty in adding it as path parameter.
Code Snippet
CloseableHttpClient client = HttpClients.createDefault();
String userId = "25efba57-673b-45ae-9eed-41588730aaaa";
String baseUri = "http://www.example.com";
URIBuilder exampleUri = new URIBuilder(baseUri);
exampleUri.addParameter("userId",userId);
String generatedUri = mandrakeUri.toString();
HttpPost httpPost = new HttpPost(generatedUri);
Generated URI = https://www.example.com/?userId=25efba57-673b-45ae-9eed-41588730aaaa
Expected URI = https://www.example.com/25efba57-673b-45ae-9eed-41588730aaaa
Please help me to add path parameter in http post. I also tried setparameter method but still not able to add it.