Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QUERY HTTP method #33430

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

desiderantes
Copy link

Fixes #32975

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 26, 2024
@desiderantes desiderantes marked this pull request as ready for review August 26, 2024 14:43
@bclozel bclozel self-assigned this Aug 26, 2024
@bclozel
Copy link
Member

bclozel commented Aug 26, 2024

Thanks for the initial efforts @desiderantes - at this point the linked issue hasn't been triaged and is very unlikely to make it to the 6.2 version. We'll need thorough reviews and testing for this one.

Note that since this is a new HTTP method and new feature, I don't think we will want to introduce it everywhere and for all variants of our web support. For example, I'm wondering if surfacing it as a first class citizen in RestTemplate is a good idea. Maybe using the exchange variants is good enough here?

@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 26, 2024
@bclozel bclozel added this to the General Backlog milestone Aug 26, 2024
@desiderantes
Copy link
Author

@bclozel Yes no worries, just wanted to get this started somehow. I do think that supporting a new HTTP Method shouldn't be half-hearted, and ideally it would mean support everywhere, not just in the basic HttpMethod class

@bclozel
Copy link
Member

bclozel commented Aug 26, 2024

@desiderantes We're trying to balance maintenance and evolution, especially around parts that have been very stable for a long time. Adding this method as first class in WebClient and RestClient makes sense, but RestTemplate has been "feature complete" for a long time now and we don't want to expand its main surface API.

Playgirlkaybraz11

This comment was marked as abuse.

@bclozel bclozel added the status: blocked An issue that's blocked on an external project change label Aug 30, 2024
@bclozel
Copy link
Member

bclozel commented Aug 30, 2024

Marking as blocked for now because #32975 (comment)

@desiderantes desiderantes marked this pull request as draft August 30, 2024 16:05
@desiderantes desiderantes marked this pull request as ready for review October 19, 2024 03:13
Copy link

@pankratz76 pankratz76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of effort has been made thanks. Despite its a lot of code its done ver precise. Nicely done 👍

Comment on lines +621 to +624
}



Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

Comment on lines +749 to +750


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines +1076 to +1077
boolean isQuery = HttpMethod.QUERY.matches(method);
if (isGet || isQuery || HttpMethod.HEAD.matches(method)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
boolean isQuery = HttpMethod.QUERY.matches(method);
if (isGet || isQuery || HttpMethod.HEAD.matches(method)) {
boolean isQuery = HttpMethod.QUERY.matches(method);
boolean isHead = HttpMethod.HEAD.matches(method);
if (isGet || isQuery || isHead) {

align pattern

@pankratz76
Copy link

pankratz76 commented Mar 13, 2025

rking as blocked for now becau

maybe then putting this PR into draft mode would help or communicate or even close as not planned. It can be reopened anytime

MockHttpServletRequest request = new MockHttpServletRequestBuilder(POST).uri("/foo")
.contentType(contentType).content(body.getBytes(UTF_8))
.buildRequest(this.servletContext);
for (HttpMethod method : List.of(POST, QUERY)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be better to use parametrized tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: blocked An issue that's blocked on an external project change type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for the HTTP QUERY method
7 participants