Dart http: “Bad state: Can't finalize a finalized Request” when retrying a http.Request after fetching a new access token
问题 I'm currently trying to access a Web API in Flutter that requires a JWT access token for authorization. The access token expires after a certain amount of time. A new access token can be requested with a separate refresh token. Right now this access token refresh is performed as soon as a request returns a 401 response. After that, the failed request should be retried with the new access token . I'm having trouble with this last step. It seems like a http.BaseRequest can only be sent once.