
Learn to create and develop our own HTTP client Engo in Go, building a baseline public library to solve problems with the default HTTP client.
The lecture guides you to build a productive http client in Go, balancing performance, testing readiness, and deployment, while applying marketplace experience to solve business problems.
Develop a robust Go HTTP client with the standard library, emphasizing customization, testing, and mocking, while avoiding brittle third-party dependencies.
Learn to build a productive Go http client with a configurable client builder, handling headers, timeouts, and JSON payloads, plus mock server testing and real API examples.
Explore how an HTTP call works in Go, including the method, URL, headers, and a JSON body; learn to handle responses and round-trip timing for a productive client.
Explore how to handle timeouts in a Go http client, configuring connection and request timeouts to abort after thresholds during dns, handshake, and round-trip steps.
Build a basic http get request against the GitHub API using Go's net/http package, including headers such as Accept: application/json, and handle the response.
explain why the default http client in go has no timeouts, causing slow responses and high cpu, and show how to configure timeouts and build a reusable internal client library.
discover why building your own http client in go reduces duplicated logic, enhances testability with mocking, and provides centralized timeouts and metrics across services.
Explore creating a go http client project and mastering go modules, including go mod, GOPATH, module paths, and dependency management with tidy and external dependencies.
Build a modular HTTP client library in Go with a public interface, implement methods on a concrete type, and expose a clean API via a constructor.
Build a configurable http client in Go by implementing a Do method, handling method, headers, and body, and exposing a public interface for get, post, patch, and delete.
Define and send custom and common headers in a Go HTTP client by building a headers map, applying per-request and global headers, and using a singleton client.
Learn how to send a post request in Go by using a user struct as the body, marshal to JSON by default, and implement content-type management with headers.
Develop robust go http clients by applying unit, integration, and functional tests using Go's built-in testing framework and go test; verify headers handling and achieve meaningful coverage.
Develop robust Go unit tests by enforcing initialization, execution, and validation, using unique test cases to measure true behavior beyond 100 percent coverage and avoiding typos and copy-paste errors.
Learn to configure timeouts in a Go HTTP client by setting dial context, response header timeout, and max idle connections, while reusing a single client to avoid per-request creation.
Configure customizable timeouts and max idle connections for a Golang http client with a builder, exposing interface methods and defaults that fit different business contexts.
Learn to disable timeouts in a Go http client by adding a disable timeouts option. Separate configuration from execution with a builder, timeout handling and enabling zero timeout when needed.
Explore applying the builder pattern to an http client in Go by separating client from builder, exposing a chainable configuration interface, and building a configured client with a build method.
Refactor the HTTP client by moving configurations into a private builder and building the client from that builder to avoid duplication, expose a public interface, and validate with GitHub fetch.
Leverage sync.Once in the Go HTTP client builder to initialize a single, concurrency-safe client, ensuring all requests share one instance.
Learn to build a custom Go http client response that exposes status, headers, and body, with helpers for JSON unmarshalling and automatic body closing.
Create and demonstrate examples to show how to build a singleton HTTP client in Go, configure timeouts, interact with GitHub API endpoints, and plan mocking for tests.
Explains why a Go http client library should provide built-in mocking features to simplify testing and avoid external mock servers.
Define and use a mock struct to drive http client tests in Go. Create mock keys from method, url, and body to configure errors, responses, and status codes.
Add a mock server for the Go HTTP client by building a mock map keyed by method, URL, and body, with mutex safeguards to support tests and mock GitHub endpoints.
Learn to build a mock server that derives a mock key from method, URL, and body to return predefined responses for testing, achieving 100 percent test coverage with go test.
Add a default mock to the Go HTTP client by starting a mock server and configuring responses. Ensure behavior when the mock is enabled or disabled and verify test coverage.
Learn how to use a Dimmock server to share mocks across multiple Go clients, flush all mocks between tests, and ensure a fresh testing environment without hitting real APIs.
Clean the request body before using it as a mock key, then generate a cleaner key from the method and body, and test the http client with mocks.
Learn how to publish and start using a Go library by applying semantic versioning (major, minor, patch), preparing the module, running tests, and tagging and pushing the version.
Convert a legacy dep project to a Go module, initialize the module, integrate a http client library, and build and test endpoints against GitHub data.
Explore how to test API calls in Go using a mocking library to achieve 100 percent test coverage with mock servers.
Provide a way for users to supply their own http client through a builder method. Let users reuse existing clients, enable mocks, and preserve configurations with a clean, extensible interface.
Refine the public interface of a Go HTTP client by exposing get, post, patch, delete, and options with flexible header handling and a baryonic header type.
Learn to document Go code for a public http client library, using the standard library docs, writing clear public and private method comments, and keeping code and docs synchronized.
Expand the Go http client by adding a GitHub repository creation example, implementing a post request, error handling, and mock-based tests to improve coverage.
Enable users to define a custom user agent for each http client by implementing set_user_agent in the builder and updating the public API, while carefully handling headers.
Define a dedicated constants package for common http headers, such as content type and user agent, ensuring consistent values, reusable tests, and a clean, testable http client design.
Release the first stable version of the go http client library, ensure tests pass, merge the branch into master, tag version 1.0.0, and showcase std library usage with mocking.
Refine a productive Go http client by cleaning the mocking interface, isolating test mocks into a dedicated package, and exposing a clear public interface with a builder and client.
Learn to decouple production and test code by introducing an HTTP client interface, implement a mock client, and switch between real and mocked responses for reliable Go HTTP testing.
Convert all exported functions into methods on a single mock server and expose start and stop controls. Update the README and documentation, and promote a major version three.
Learn how to build a productive Go HTTP client with a middle layer that centralizes calls, enables mock features, and exposes a configurable public interface for scalable microservices.
Have you ever called a REST API from your Go program? Did you implemented your own HTTP client or did you ended up using some of the thousand libraries out there? Do you know what your HTTP client is doing in the background?
In this course we're starting from scratch! We're going to remember how a basic HTTP call looks like by digging into the request & response objects. We're going to write a basic HTTP client to perform HTTP requests and then use it in productive applications. What issues do we have? Can we scale our applications by following this approach? Of course not! That's why we're creating an HTTP client library that provides:
Fast, reliable and friction-free HTTP connections.
Support for all HTTP methods: GET, POST, PUT, DELETE, PATCH and more!
A Concurrency-Safe HTTP client that you can use without worrying about performance.
Content type management and optimization.
Mocking features out of the box.
A clean interface in case you want to unit test your code without relying on integration testing features.
A robust implementation so you won't need any external dependency whatsoever.
Completely customizable interface: timeouts, transport layer, custom HTTP client and lots of useful features.
A library that is PRODUCTION-READY!
If you're looking to integrate a 3rd party REST APIs in your code, you'll need to perform an HTTP call to it. Make sure you take a look at this course before even considering alternatives out there that will force you to use different dependencies for running, testing and extending your code! As Robert Pike says: "A little copying is much better than a little dependency". In this course we're not only getting rid of the dependencies but we're also getting rid of the copying. We're not using anything more than the Go's standard library to design & develop our own HTTP client.
This client will the baseline for all of the applications we're going to build later, making our business scale and grow as fast as we can Go.
Take a look at the preview lessons you have available to have an idea about the structure and content of the course. I know you're going to enjoy it! If you have any doubt, take a look at my other courses and see what my students have to say!
See you on the other side!