{"repo":"earthboundkid/requests","free":true,"listed":false,"github":"https://github.com/earthboundkid/requests","clone":"git clone https://github.com/earthboundkid/requests.git","description":"HTTP requests for Gophers","language":"Go","stars":1670,"topics":["golang","requests","http","http-client","convenience","helper"],"license":"MIT","category":"dev-tools","readme_excerpt":"Requests HTTP requests for Gophers. The problem : Go's net/http is powerful and versatile, but using it correctly for client requests can be extremely verbose. The solution : The requests.Builder type is a convenient way to build, send, and handle HTTP requests. Builder has a fluent API with methods returning a pointer to the same struct, which allows for declaratively describing a request by method chaining. Requests also comes with tools for building custom http transports, include a request recorder and replayer for testing. See this note on the canonical project URL. Features - Simplifies HTTP client usage compared to net/http - Can't forget to close response body - Checks status codes by default - Supports context.Context - JSON serialization and deserialization helpers - Easily manipulate URLs and query parameters - Request recording and replaying for tests - Customizable transports and validators that are compatible with the standard library and third party libraries - No third party dependencies - Good test coverage Examples Simple GET into a string code with net/http code with requests 11+ lines 5 lines POST a raw body code with net/http code with requests 12+ lines 5 lines GET a JSON object code with net/http code with requests 18+ lines 7 lines POST a JSON object and parse the response Set custom headers for a request Easily manipulate URLs and query parameters Record and replay responses FAQs See wiki for more details. Why not just use the standard library HTTP cl","default_branch":null,"files":null,"tree":[],"storefront":"/r/earthboundkid","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/earthboundkid/requests/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}