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

Future<HttpClientResponse> response() uses in HttpClientRequest/HttpClientResponse is undocumenteted #54

Closed
jcarranzan opened this issue Dec 10, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@jcarranzan
Copy link
Contributor

jcarranzan commented Dec 10, 2020

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,...) 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

But this change is not documented in the migration guide, maybe it would be nice to have some comment on Http changes or miscellaneous changes.

@jcarranzan jcarranzan added the bug Something isn't working label Dec 10, 2020
@jcarranzan
Copy link
Contributor Author

What do you think @vietj?

@vietj
Copy link
Contributor

vietj commented Dec 14, 2020 via email

@jcarranzan
Copy link
Contributor Author

I meant in the migration guide.
In the regular doc as far as I know neither.

@vietj
Copy link
Contributor

vietj commented Dec 14, 2020 via email

@jcarranzan
Copy link
Contributor Author

sure!

@jcarranzan
Copy link
Contributor Author

jcarranzan commented Dec 15, 2020

We could add in the migration guide in the Http changes section and following the same styles of the other sections examples :

In vertx 4, with the HttpClientRequest is used the Future response implementation and we return the future of the HttpClientResponse in the result method.

The following example shows an example using HTTP client in {VertX} {v3x} releases:

HttpClient client = vertx.createHttpClient(options);

    client.request(HttpMethod.GET, 8443, "localhost", "/")
      .onSuccess(request -> {
        request.onSuccess(resp -> {

        //Handler some operation with the response
        });
      });

The following example shows an example using HTTP client with the result method in {VertX} {v4x} releases:

HttpClient client = vertx.createHttpClient(options);

    client.request(HttpMethod.GET, 8443, "localhost", "/")
      .onSuccess(request -> {
        request.response().onSuccess(resp -> {

        //Handler some operation with the response
        });
      });

what do you think @vietj ?

@vietj
Copy link
Contributor

vietj commented Dec 16, 2020

can you do a PR it's easier for commenting. thanks

@jcarranzan
Copy link
Contributor Author

sure!

#57

@sangeetaraghu
Copy link
Contributor

Hi @vietj, @jcarranzan,

We can close this issue. It is resolved.
#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants