-
Notifications
You must be signed in to change notification settings - Fork 691
Open
Labels
for/team-attentionThis issue needs team attentionThis issue needs team attention
Milestone
Description
Take a look at this API
client
.headers(builder -> {
builder.add(COOKIE, new DefaultCookie(SESSION_ID, "hello"));
})
.post()
.uri("/uri")
.send(ByteBufFlux.fromString(just("hi")))
.response((httpClientResponse, byteBufFlux) -> {
return just(sessionIdAndApiKey);
});When you look at the method post(), your intuition tells that the POST call is being made. But as per API, you are building a request that uses http POST method when the actual subscription happens & the request building ends with send AFAIK
This is a flawed api design as it breaks intuition. The same is true for all other http methods aswell. This flaw first appeared in WebClient API of Webflux & is now carried to reactor-netty aswell
Any action methods get(), post(), e.t.c would be considered by most developers as ACTION methods, not builder methods
A suggestion I have is to name these methods use<Op> (or) <op>Builder() (or) for<Op>, i.e client.useGet() (or) client.getBuilder() (or) client.forGet()
Metadata
Metadata
Assignees
Labels
for/team-attentionThis issue needs team attentionThis issue needs team attention