Skip to content

Commit e01b4d7

Browse files
authored
Update README.md
1 parent 745eb8f commit e01b4d7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

web/httpclient/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ It supports sending requests both synchronously and asynchronously by calling it
1818
respectively. A *Builder* is provided to create an instance. Once the client is created, the instance is immutable.
1919
* **HttpRequest**: It encapsulates an HTTP request, including the target URI, the method (GET, POST, DELETE), headers and other information.
2020
A request is constructed using a builder, is immutable once created, and can be sent multiple times.
21-
* **HttpRequest.BodyPublisher**: If a request has a body (e.g. in POST requests), this is the entity responsible for publishing
22-
the body content from a given source, for instance, from a string or a file.
23-
* **HttpResponse**: It encapsulates an HTTP response, including headers and a message body, if any. This is what the client
24-
receives after sending an *HttpRequest*.
25-
* **HttpResponse.BodyHandler**: It is a functional interface that accepts some information about the response (status code and headers),
26-
and returns a *BodySubscriber*, which itself handles consuming the response body.
21+
* **HttpRequest.BodyPublisher**: It converts high-level Java objects into a flow of byte buffers suitable for sending
22+
as a request body froom a given source, such as a string or a file.
23+
* **HttpResponse**: It encapsulates an HTTP response, including headers and a message body, if any. The client it receives after sending an *HttpRequest*.
24+
* **HttpResponse.BodyHandler**: It handles response bodies. It is a functional interface that allows inspection of the response
25+
code and headers, before the actual response body is received, and returns a *BodySubscriber*, which itself handles consuming the response body.
2726
* **HttpResponse.BodySubscriber**: It subscribes for the response body and consumes its bytes into some other form (a string, a file,
2827
or some other storage type).
2928

29+
3030
*BodyPublisher* is a subinterface of *Flow.Publisher*, introduced in Java 9. Similarly, *BodySubscriber* is a subinterface
3131
of *Flow.Subscriber*. These interfaces are adjusted with the reactive streams approach, which is suitable
3232
for sending asynchronous requests using HTTP/2.

0 commit comments

Comments
 (0)