Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3708

URLSession across different REST endpoints for the same server

$
0
0

I have an app that makes a whole bunch of different REST calls to the same server from a bunch of different view controllers. What’s best practice with regard to URLSession: Share the same URLSession object? Or just the URLSessionConfiguration object? Or doesn’t matter about either?

For example, when making request to an endpoint, should I

  1. Instantiate a brand new URLSession each request with with the shared URLSessionConfiguration?

  2. Instantiate a single URLSession once for the current active app instance, and reuse it across all requests?


Viewing all articles
Browse latest Browse all 3708

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>