Composite Requests in Salesforce Are a Great Idea

Of all the development eras I’ve witnessed in my 30+ years building apps and features, the RESTful API design pattern is my favorite. Prior to the RESTful approach, I always felt like something was missing when developing web applications.

My concerns were put to rest when I attended the Gartner Enterprise Architecture Summit in 2008. Most notably, a session called “SOAP v REST” was not only informative and funny, but it opened my eyes. I walked away with a desire to understand more about RESTful APIs and soon started experimenting with this new design pattern during my personal time.

JDK 11 HTTP Client API – Handling Request/Response Body Types

This article is a supersonic guide to dealing with request and response body types in an HTTP Client API. Let's start with the request body types.

Handling Request Body Types

Setting a request body can be accomplished using  HttpRequest.Builder.POST()  and PUT()  or by using  method()(for example, method("PATCH", HttpRequest.BodyPublisher)). The POST()  and  PUT()  take an argument of the  HttpRequest.BodyPublisher  type.