Skip to content

Test and document HTTP QUERY support - #1451

Merged
ryanjbaxter merged 1 commit into
spring-cloud:mainfrom
kumarprabhashanand:http-query-support
Oct 23, 2026
Merged

ryanjbaxter merged 1 commit into
spring-cloud:mainfrom
kumarprabhashanand:http-query-support

Conversation

@kumarprabhashanand

Copy link
Copy Markdown
Contributor

Adds tests and documents which HTTP clients can send QUERY.

Spring Framework 7.1 adds RequestMethod.QUERY for the HTTP QUERY method (RFC 10008), and Feign 13.14 adds Request.HttpMethod.QUERY (OpenFeign/feign#3454). This project uses Feign 13.17, and SpringMvcContract converts the Spring method with Request.HttpMethod.valueOf(...), so @RequestMapping(method = RequestMethod.QUERY) already works.

Changes:

  • SpringMvcContractTests: a QUERY method with a @RequestBody maps to method QUERY with that body.
  • FeignHttpClientTests (Apache HttpClient 5) and FeignHttp2ClientTests (Java HTTP client): an end-to-end testQuery through a load-balanced @FeignClient.
  • QuerySecurityConfiguration (test only): allows QUERY in those test apps, since Spring Security's StrictHttpFirewall rejects it by default (RequestRejectedException).
  • Docs: an "HTTP QUERY Support" section under "Spring @RequestMapping Support". The default HttpURLConnection based client cannot send QUERY, so it points to Apache HttpClient 5 and Java HTTP client.

Validation (locally with Java 17):

  • ./mvnw -pl spring-cloud-openfeign-core test: 463 tests, 0 failures, 0 errors, 7 skipped (existing)
  • ./mvnw -pl docs -P docs antora:antora: build succeeded, and the generated page shows the new section

Spring Framework 7.1 adds RequestMethod.QUERY (RFC 10008) and Feign
13.14 adds Request.HttpMethod.QUERY, so SpringMvcContract already maps
@RequestMapping(method = RequestMethod.QUERY) without code changes.

Add a contract test, and load-balanced end-to-end tests for the Apache
HttpClient 5 and Java HTTP clients next to the existing PATCH tests.
The test applications allow QUERY in Spring Security's
StrictHttpFirewall, which rejects it by default.

Document how to declare a QUERY method and which clients can send it.
The default HttpURLConnection-based client cannot.

Signed-off-by: Prabhash <8548359+kumarprabhashanand@users.noreply.github.com>
@ryanjbaxter ryanjbaxter added this to the 5.1.0-RC2 milestone Oct 23, 2026
@ryanjbaxter
ryanjbaxter merged commit 154979b into spring-cloud:main Oct 23, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in 2026.0.0-RC2 Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants