github.com/arielsrv/golang-toolkit/rest (go): Package rest is an extremely simple to use, lightweight, yet powerful REST Client.  The Go http standard library is a great library, but it might sometimes be a bit too low level to use, and it doesn't offer features like fork-join requests for better performance, response caching based on headers, and the possibility to mockup responses.  v0.1  v0.2  v0.3  v0.4  v0.5  Caching is done by two strategies working together: Time To Live (TTL) and Least Recently Used (LRU). Objects are inserted in the cache based on Response Headers. You can establish a maximum Memory Size for the cache and objects are flushed based on time expiration (TTL) or by hitting the maximum memory limit. In the last case, least accessed objects will be removed first.  Installation  Importing  Simple GET  Simple POST  Simple POST, with Struct Body  ForkJoin let you **fork** requests, and **wait** until all of them have return.  Concurrent has methods for Get, Post, Put, Patch, Delete, Head & Options, with the almost the same API as the synchronous methods. The difference is that these methods return a FutureResponse, which holds a pointer to Response. Response inside FutureResponse is nil until request has finished.  Async let you make Restful requests in an **asynchronous** way, without blocking the go routine calling the Async function.  Whenever the Response is ready, the **f** function will be called back.  Defaults * Headers: keep-alive, Cache-Control: no-cache * Timeout: 2 seconds * ContentType: JSON (for body requests in POST, PUT and PATCH) * Cache: enable * Cache Size: 1GB * Idle Connections Per Host: 2 (the default of http.net package) * HTTP/2: automatic with Go 1.6 * Gzip: automatic support for gzip responses  RequestBuilder gives you the power to go beyond defaults. It is possible to set up headers, timeout, baseURL, proxy, contentType, not to use cache, directly disabling timeout (in an explicit way), and setting max idle connections.  When using mockups, all requests will be sent to the mockup server. To activate the mockup *environment* you have two ways: using the flag -mock  Or by programmatically starting the mockup server  An example
Keywords: connection-pool|fast|generics|go|golang|http|http-client|restclient|restful|toolkit|transport