rdblue commented on code in PR #4771:
URL: https://github.com/apache/iceberg/pull/4771#discussion_r873224420
##########
core/src/main/java/org/apache/iceberg/rest/HTTPClient.java:
##########
@@ -151,15 +151,15 @@ private <T> T execute(
String fullUri = String.format("%s/%s", uri, path);
HttpUriRequestBase request = new HttpUriRequestBase(method.name(),
URI.create(fullUri));
- addRequestHeaders(request);
- if (requestBody != null) {
- try {
- StringEntity stringEntity = new
StringEntity(mapper.writeValueAsString(requestBody));
- request.setEntity(stringEntity);
- } catch (JsonProcessingException e) {
- throw new RESTException(e, "Failed to write request body: %s",
requestBody);
- }
+ if (requestBody instanceof Map) {
Review Comment:
This change updates `HTTPClient` so that a string map will be form encoded
rather than JSON encoded. This minimizes the changes needed to support requests
to the `v1/oauth/token` endpoint, but an alternative is to add another method,
`RESTClient.formPost`, to send map data encoded as
`application/x-www-form-urlencoded` instead of JSON.
@danielcweeks, what do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]