AFNetworking: Handle error globally and repeat request

前端 未结 6 1655
温柔的废话
温柔的废话 2020-12-07 11:07

I have a use case that should be rather common but I can\'t find an easy way to handle it with AFNetworking:

Whenever the server returns a specific status code for <

6条回答
  •  时光说笑
    2020-12-07 12:02

    To ensure that multiple token refreshes are not issued at around the same time, it is beneficial to either queue your network requests and block the queue when the token is refreshing, or add a mutex lock (@synchronized directive) to your token refresh method.

提交回复
热议问题