private static QueryParams queryParamsOf(@Nullable String query,
                                                 @Nullable MediaType contentType,
                                                 AggregatedResult result) {
            try {
                final QueryParams params1 = query != null ? QueryParams.fromQueryString(query) : null;
                QueryParams params2 = null;
                if (isFormData(contentType)) {
                    assert contentType != null;
                    final AggregatedHttpRequest message = result.aggregatedHttpRequest;
                    if (message != null) {
                        // Respect 'charset' attribute of the 'content-type' header if it exists.
                        final String body = message.content(contentType.charset(StandardCharsets.US_ASCII));
                        if (!body.isEmpty()) {
                            params2 = QueryParams.fromQueryString(body);
                        }
                    }
                } else if (isMultipartFormData(contentType)) {
                    final FileAggregatedMultipart multipart = result.aggregatedMultipart;
                    if (multipart != null) {
                        params2 = QueryParams.builder().add(multipart.params().entries()).build();
                    }
                }

                if (params1 == null || params1.isEmpty()) {
                    return firstNonNull(params2, QueryParams.of());
                } else if (params2 == null || params2.isEmpty()) {
                    return params1;
                } else {
                    return QueryParams.builder()
                                      .sizeHint(params1.size() + params2.size())
                                      .add(params1)
                                      .add(params2)
                                      .build();
                }
            } catch (Exception e) {
                // If we failed to decode the query string, we ignore the exception raised here.
                // A missing parameter might be checked when invoking the annotated method.
                logger.debug("Failed to decode query string: {}", query, e);
                return QueryParams.of();
            }
        }
Returns a {@link QueryParams} decoded from a request.

<p>Usually one of a query string of a URI or URL-encoded form data is specified in the request.
If both of them exist though, they would be decoded and merged into a parameter map.</p>

<p>Names and values of the parameters would be decoded as UTF-8 character set.</p>

@see QueryParams#fromQueryString(String)
@see HttpConstants#DEFAULT_CHARSET
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolver.java