Skip to content

Commit

Permalink
Fix 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 9cb5c7f commit 448188e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ 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 448188e

Please sign in to comment.