Skip to content

Commit

Permalink
Use toQueryString() for PUT/POST body
Browse files Browse the repository at this point in the history
  • Loading branch information
andywebb1975 committed May 10, 2024
1 parent 9c04c6b commit 6c6e183
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ private PreparedRequest preparePutOrPost(
ModifiableSolrParams requestParams = queryParams;
queryParams = calculateQueryParams(urlParamNames, requestParams);
queryParams.add(calculateQueryParams(solrRequest.getQueryParams(), requestParams));
bodyPublisher = HttpRequest.BodyPublishers.ofString(requestParams.toString());
// note the toQueryString() method adds a leading question mark which needs to be removed here
bodyPublisher =
HttpRequest.BodyPublishers.ofString(requestParams.toQueryString().substring(1));
} else {
bodyPublisher = HttpRequest.BodyPublishers.noBody();
}
Expand Down

0 comments on commit 6c6e183

Please sign in to comment.