{"id":25619140,"url":"https://github.com/FabienHenon/jsonapi-http-retry","last_synced_at":"2025-02-22T06:16:03.144Z","repository":{"id":57674598,"uuid":"255885124","full_name":"FabienHenon/jsonapi-http-retry","owner":"FabienHenon","description":"Retry failed jsonapi requests with retry policies","archived":false,"fork":false,"pushed_at":"2021-09-27T15:15:49.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T06:16:00.642Z","etag":null,"topics":["elm","elm-lang","http","jsonapi","remotedata","retry"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/FabienHenon/jsonapi-http-retry/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FabienHenon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-15T10:39:37.000Z","updated_at":"2021-09-27T15:15:45.000Z","dependencies_parsed_at":"2022-09-02T15:01:42.808Z","dependency_job_id":null,"html_url":"https://github.com/FabienHenon/jsonapi-http-retry","commit_stats":null,"previous_names":["calions-app/jsonapi-http-retry"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienHenon%2Fjsonapi-http-retry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienHenon%2Fjsonapi-http-retry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienHenon%2Fjsonapi-http-retry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FabienHenon%2Fjsonapi-http-retry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FabienHenon","download_url":"https://codeload.github.com/FabienHenon/jsonapi-http-retry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240131730,"owners_count":19752727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elm","elm-lang","http","jsonapi","remotedata","retry"],"created_at":"2025-02-22T06:16:02.215Z","updated_at":"2025-02-22T06:16:03.109Z","avatar_url":"https://github.com/FabienHenon.png","language":"Elm","readme":"# jsonapi-http-retry\n\nRetry failed jsonapi requests with retry policies.\n\nIt is greatly inspired by the [`Retry` package](https://package.elm-lang.org/packages/choonkeat/elm-retry/latest/) but aims to handle http requests from the [`jsonapi-http` package](https://package.elm-lang.org/packages/calions-app/jsonapi-http/latest/).\n\nWith this package you can add retry policies to [`jsonapi-http`](https://package.elm-lang.org/packages/calions-app/jsonapi-http/latest/) requests errors.\nYou can choose specific errors that will trigger a retry: unauthenticated error, network error, etc...\n\nYou can also send `Cmd`s between 2 failures with the `Http.CmdRetry` module.\n\n## Getting Started\n\nHere is an example retrying requests 5 times maximum with a constant interval between retries, only for unauthenticated and unauthorized errors:\n\n```elm\nimport Http.Request\nimport Http.Retry\nimport Json.Encode\nimport JsonApi.Decode\n\nrequest : Cmd Msg\nrequest =\n    Request.request\n        { url = \"http://endpoint\"\n        , headers = []\n        , body = Json.Encode.object []\n        , documentDecoder = JsonApi.Decode.resources \"resource-type\" entityDecoder\n        }\n        |\u003e Http.Retry.with\n            [ Http.Retry.maxRetries 5\n            , Http.Retry.exponentialBackoff { interval = 500, maxInterval = 3000 }\n            ]\n            [ Http.Retry.onUnauthenticatedStatus\n            , Http.Retry.onUnauthorizedStatus\n            ]\n        |\u003e Task.perform OnTaskCompleted\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFabienHenon%2Fjsonapi-http-retry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFabienHenon%2Fjsonapi-http-retry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFabienHenon%2Fjsonapi-http-retry/lists"}