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

Processing HTTP requests #5

Open
msmolyak opened this issue Mar 18, 2015 · 3 comments
Open

Processing HTTP requests #5

msmolyak opened this issue Mar 18, 2015 · 3 comments

Comments

@msmolyak
Copy link

I am using 3.0.1 version of vertx-when with Vertx 2.1.5. What is the proper way to use WhenHttpClient to

  • Set HTTP headers
  • Send POST body

Neither the documentation, nor the source code make it clear. I could not find a place in the code where headers or requestBody can be passed in or where they would be added to the HttpClientRequest object.

@adrianluisgonzalez
Copy link
Member

You can provide a setup handler which gives you full access to the HttpClientRequest to add headers and call request.end() providing a post body.

Here's one of the overloads:
https://github.com/englishtown/vertx-when/blob/3.0.1/src/main/java/com/englishtown/vertx/promises/WhenHttpClient.java#L37

@msmolyak
Copy link
Author

Adrian,

Does vertx-when 3.0.1 support SSL connection with its DefaultWhenHttpClient? Is there a way to set SSL to true and pass in key store and trust store parameters?

Thank you,

Michael

@adrianluisgonzalez
Copy link
Member

I spoke to soon, here's an updated response:

There are a number of overloads that allows you to pass in the HttpClient you have initialized with whatever SSL parameters you like.

https://github.com/englishtown/vertx-when/blob/3.0.1/src/main/java/com/englishtown/vertx/promises/WhenHttpClient.java#L82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants