gout – Go HTTP Client Library Overview
The gout library is a Go‑based HTTP client that offers extensive request configuration, body encoding, response parsing, benchmarking, retry logic, raw packet sending, curl export, and custom client injection, with recent updates adding a WithTimeout option and improved handling of empty values.
Update
Added a WithTimeout option to the gout.NewWithOpt interface and changed the behavior so that empty values are no longer ignored for keys.
Full Documentation
gout
gout is an HTTP client written in Go, developed to improve development efficiency.
Features
Support for GET, PUT, DELETE, PATCH, HEAD, OPTIONS methods.
Ability to set HTTP headers (accepting struct, map, array, slice, etc.).
Ability to set URL query parameters (accepting struct, map, array, slice, string, etc.).
Encode request body as JSON (accepting struct, map, string, []byte, etc.).
Encode request body as XML (accepting struct, string, []byte, etc.).
Encode request body as YAML (accepting struct, map, string, []byte, etc.).
Encode request body as Protobuf (accepting struct).
Support for form‑data (accepting struct, map, array, slice, etc.).
Support for x‑www‑form‑urlencoded (accepting struct, map, array, slice, etc.).
Support for sending raw types such as io.Reader, uint, int, string, []byte, float32, float64 to the request body.
Parse response body JSON, XML, YAML into structs (BindJSON/BindXML/BindYAML).
Parse response body directly into io.Writer or primitive types.
Parse response headers into structs.
Performance benchmarking with configurable iteration count, duration, and frequency.
Retry‑backoff mechanism with customizable retry conditions.
Ability to send raw HTTP packets.
Export request as a curl command.
Inject a custom *http.Client.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
