go-retryablehttp | Retryable HTTP client in Go | HTTP library

 by   hashicorp Go Version: v0.7.4 License: MPL-2.0

kandi X-RAY | go-retryablehttp Summary

kandi X-RAY | go-retryablehttp Summary

go-retryablehttp is a Go library typically used in Networking, HTTP applications. go-retryablehttp has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has medium support. You can download it from GitHub.

[Go Documentation] [travis]: [godocs]: The retryablehttp package provides a familiar HTTP client interface with automatic retries and exponential backoff. It is a thin wrapper over the standard net/http client library and exposes nearly the same public API. This makes retryablehttp very easy to drop into existing programs. retryablehttp performs automatic retries under certain conditions. Mainly, if an error is returned by the client (connection errors, etc.), or if a 500-range response code is received (except 501), then a retry is invoked after a wait period. Otherwise, the response is returned and left to the caller to interpret. The main difference from net/http is that requests which take a request body (POST/PUT et. al) can have the body provided in a number of ways (some more or less efficient) that allow "rewinding" the request body if the initial request fails so that the full request can be attempted again. See the [godoc] for more details. Version 0.6.0 and before are compatible with Go prior to 1.12. From 0.6.1 onward, Go 1.12+ is required. From 0.6.7 onward, Go 1.13+ is required.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              go-retryablehttp has a medium active ecosystem.
              It has 1580 star(s) with 225 fork(s). There are 270 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 34 open issues and 46 have been closed. On average issues are closed in 78 days. There are 25 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of go-retryablehttp is v0.7.4

            kandi-Quality Quality

              go-retryablehttp has 0 bugs and 0 code smells.

            kandi-Security Security

              go-retryablehttp has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              go-retryablehttp code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              go-retryablehttp is licensed under the MPL-2.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              go-retryablehttp releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              It has 1405 lines of code, 62 functions and 4 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of go-retryablehttp
            Get all kandi verified functions for this library.

            go-retryablehttp Key Features

            No Key Features are available at this moment for go-retryablehttp.

            go-retryablehttp Examples and Code Snippets

            No Code Snippets are available at this moment for go-retryablehttp.

            Community Discussions

            QUESTION

            http retry for Request Timeout (408)
            Asked 2021-Aug-03 at 14:01

            Using hashicorp go-retryablehttp library (https://github.com/hashicorp/go-retryablehttp)

            It retries automatically for all 5xx code:

            retryablehttp performs automatic retries under certain conditions. Mainly, if an error is returned by the client (connection errors, etc.), or if a 500-range response code is received (except 501), then a retry is invoked after a wait period. Otherwise, the response is returned and left to the caller to interpret.

            Is that possible it retries on Request Timeout, e.g. on 408 http status code just ootb?
            or I should build some custom wrappers?

            ...

            ANSWER

            Answered 2021-Aug-03 at 13:44

            QUESTION

            How to use go-retryablehttp with a Client with a custom Transport?
            Asked 2020-Nov-30 at 23:31

            I would like to understand how to use go-retryablehttp with a Client with a custom Transport, let's say for instance to disable TLS validation, how can this be achieved?

            ...

            ANSWER

            Answered 2020-Nov-30 at 23:31

            You can access the underlying http client as seen in this issue. Here is a small example of ignoring an self signed cert error at 127.0.0.1:8030

            Source https://stackoverflow.com/questions/65082477

            QUESTION

            How to customize http.Client or http.Transport in Go to retry after timeout?
            Asked 2020-Jul-15 at 16:08

            I want to implement a custom http.Transport for standard http.Client, which will retry automatically if the client got timeout.

            P.S. for some reason, the custom http.Transport is a must-have. I've already checked hashicorp/go-retryablehttp, however it won't let me use my own http.Transport.

            Here's my attempts, the custom component:

            ...

            ANSWER

            Answered 2020-Jul-15 at 06:52

            There is no need to customize the http.Client or such things. You can simply wrap your fetch operation into a retry -- there are plenty of modules available that do the trick:

            Source https://stackoverflow.com/questions/62900451

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install go-retryablehttp

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/hashicorp/go-retryablehttp.git

          • CLI

            gh repo clone hashicorp/go-retryablehttp

          • sshUrl

            git@github.com:hashicorp/go-retryablehttp.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular HTTP Libraries

            requests

            by psf

            okhttp

            by square

            Alamofire

            by Alamofire

            wrk

            by wg

            mitmproxy

            by mitmproxy

            Try Top Libraries by hashicorp

            terraform

            by hashicorpGo

            vault

            by hashicorpGo

            consul

            by hashicorpGo

            vagrant

            by hashicorpRuby

            packer

            by hashicorpGo