You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: web/httpclient/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,15 @@ It supports sending requests both synchronously and asynchronously by calling it
18
18
respectively. A *Builder* is provided to create an instance. Once the client is created, the instance is immutable.
19
19
***HttpRequest**: It encapsulates an HTTP request, including the target URI, the method (GET, POST, DELETE), headers and other information.
20
20
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.
27
26
***HttpResponse.BodySubscriber**: It subscribes for the response body and consumes its bytes into some other form (a string, a file,
28
27
or some other storage type).
29
28
29
+
30
30
*BodyPublisher* is a subinterface of *Flow.Publisher*, introduced in Java 9. Similarly, *BodySubscriber* is a subinterface
31
31
of *Flow.Subscriber*. These interfaces are adjusted with the reactive streams approach, which is suitable
0 commit comments