How to cancel a URL session request

后端 未结 3 903
野趣味
野趣味 2021-01-12 12:57

I am upload multiple image to server using convert image to base64 and send image in a API as a parameter. But when we call api again and again then how to stop api calling

3条回答
  •  春和景丽
    2021-01-12 13:22

    You can check result of your task. And if everything is alright you can

    task.resume()

    but if not

    task.cancel()

提交回复
热议问题