{"repo":"lucperkins/rek","free":true,"listed":false,"github":"https://github.com/lucperkins/rek","clone":"git clone https://github.com/lucperkins/rek.git","description":"An easy HTTP client for Go. Inspired by the immortal Requests.","language":"Go","stars":381,"topics":["go","golang","http-client","requests","python-requests"],"license":"MIT","category":"dev-tools","readme_excerpt":"rek An easy HTTP client for Go inspired by Requests, plus all the Go-specific goodies you'd hope for in a client. Here's an example: Responses The Response struct has the following methods: Method Description Return type :------ :------------ :----------- StatusCode() HTTP status code, e.g. 200, 400 int Body() The HTTP response body as a reader io.ReadCloser Headers() The response headers map[string]string Encoding() The content encoding of the response body, e.g. gzip []string ContentType() The value of the Content-Type header string Raw() The unmodified http.Response http.Response Cookies() The cookies attached to the response [] http.Cookie ContentLength() The length of the response int64 Status() The status of the response, e.g. 200 OK string HTTP response body Keep in mind that the HTTP response body can only be read once . This is one area in which rek does not directly correspond to the Requests API. And so this, for example, won't work the way you might want: If you'd like to use the response body more than once, store it in a variable rather than re-accessing the body. Helper methods There are two simple helper methods for working with the response body: Function Return types :-------- :------------ BodyAsString(io.ReadCloser) (string, error) BodyAsBytes(io.ReadCloser) ([]byte, error) Bear in mind the caveat mentioned above, that the request body can only be read once, still holds. Here are some examples: Non-standard methods rek natively supports the methods GET , P","default_branch":null,"files":null,"tree":[],"storefront":"/r/lucperkins","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lucperkins/rek/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."}