railwaymen / restler

Make simple API request using functional programming
MIT License
2 stars 3 forks source link

Add method for specifying custom URLSession instance #41

Closed sprzenus closed 4 years ago

sprzenus commented 4 years ago

General Description

The programmer should be able to use custom URLSession if he wants to. The default session is URLSession.shared and it will be used if not specified.

Implementation Details

This modifier should be a member of the RestlerRequest protocol with the same implementation for each Request subtype.

restler.get("profile")
  .decode(Profile.self)
  .using(session: .shared) // Set session to use
  .subscribe(...) // or rx