HttpResponse:

Represents a response to a HttpRequest. A HttpResponse is available when the response status code and headers have been received, but before the response body is received.

Note:

Below examples requires jdk.incubator.httpclient,It should be in our module-info.java.Refer Java 9 module example for more details on modularity.

Example 1:

Using new http client api we can build HttpRequest ,send using HttpClinet and define response bodyhandler,here we have use asString as a response body handler.We can also get information regarding sslParameters like maximum packet size ,cipher suits , client authentication needed or not , etc…

JavaDeveloperZone is the group of innovative software developers. We are expert in Java JEE and BigData application development. Our contributions will help Java developers and make development journey easy. Feel free to ask any question and suggestion. Always have space for improvement !
We are also providing software application development as service. Contact us