ok2c commented on code in PR #844:
URL:
https://github.com/apache/httpcomponents-client/pull/844#discussion_r3536825014
##########
httpclient5-jakarta-rest-client/src/main/java/org/apache/hc/client5/http/rest/RestInvocationHandler.java:
##########
@@ -244,6 +251,21 @@ private CompletableFuture<?> dispatchAsync(final Class<?>
rawType,
return result.getBody();
});
}
+ if (isNameValuePairCollection(method, async)) {
+ return submit(requestProducer, new
RestResponseConsumer<>(objectMapper, StringAsyncEntityConsumer::new))
+ .thenApply(result -> {
+ throwIfError(result);
+ final Header header =
result.getHead().getFirstHeader(HttpHeaders.CONTENT_TYPE);
+ final ContentType contentType = header != null ?
ContentType.parse(header.getValue()) : null;
Review Comment:
@arturobernalg One small thing. Let's make ContentType parsing more
efficient:
```
final ContentType contentType = header != null ?
MessageSupport.parserHeaderValue(header, ContentType::parse) : null;
```
--
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]