-
Notifications
You must be signed in to change notification settings - Fork 16
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
[HttpClient-changes] handler the request-response in vertx4 #57
[HttpClient-changes] handler the request-response in vertx4 #57
Conversation
@@ -201,3 +201,36 @@ response.end(ar -> { | |||
} | |||
}); | |||
---- | |||
+ | |||
|
|||
On the other hand, we can handle the response with some operations if we want to. You can see the difference in the next examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of we use "you"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcarranzan @vietj Can we rephrase this to:
You can also handle the response with operations. The following examples demonstrate handling responses with operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I've updated it.
What do you think?
Thank you
@@ -203,7 +203,8 @@ response.end(ar -> { | |||
---- | |||
+ | |||
|
|||
On the other hand, we can handle the response with some operations if we want to. You can see the difference in the next examples. | |||
On the other hand, you can also handle the response with operations like onSuccess, compose, bodyHandler, etc. | |||
The following examples demonstrate handling responses with the operation onSuccess : | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also handle the response with methods such as, onSucces()
, compose()
, and bodyHandler()
.
The following examples demonstrate handling responses using the onSuccess()
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to point here, that is not only those 3 methods, there are a few methods more.
Motivation:
Context
Now in vertx 4.0.0 when you do some HttpClientRequest and get the result if you want to do after some operation (compose, succeed,etc) with the result before sending it, you have to add the response method that returns the Future
This change is shown in vertx examples in the core/http/proxy/client.java :
request.response().compose
vert-x3/vertx-examples@1ddfd8c#diff-330da0139766c23d1b970aa604bae5ed935b15ce6800348c696b0a5f6744f74b