September 2019
Intermediate to advanced
816 pages
18h 47m
English
Setting a request body can be accomplished using HttpRequest.Builder.POST() and HttpRequest.Builder.PUT() or by using method() (for example, method("PATCH", HttpRequest.BodyPublisher)). POST() and PUT() take an argument of the HttpRequest.BodyPublisher type. The API comes with several implementations of this interface (BodyPublisher) in the HttpRequest.BodyPublishers class, as follows:
We'll take a look at these implementations in the following sections.