...

/

Exercise: Request Builder

Exercise: Request Builder

Practice how to create a Builder class around the built-in http.request() function.

Problem statement

Create your own Builder pattern-based class around the built-in http.request() function. The builder must be able to provide at least basic facilities to specify the HTTP method, the URL, the query component of the URL, the header parameters, and the eventual body data to be sent. To send the request, provide an invoke() method that returns a Promise for the invocation.

Coding

...