freshOS / ws-deprecated

⚠️ Deprecated - (in favour of Networking) :cloud: Elegantly connect to a JSON api. (Alamofire + Promises + JSON Parsing)
MIT License
353 stars 32 forks source link

Add support for RequestAdapter #62

Closed n13 closed 5 years ago

n13 commented 5 years ago

Addresses this issue: https://github.com/freshOS/ws/issues/61

RequestAdapter allows the client to make changes to the URL request before it goes out, so for example we can update the authentication token with a bearer token which changes frequently.

new methods wsRequest() and wsUpdate are copies of the Alamofire methods except they set the request adapter - if any - before firing off the request.

Alamofire 5 will have an asyncrhonous request adapter that will allow async calls to be made before requests are sent off, but this is still based on AF4.

n13 commented 5 years ago

removing this, added RequestRetrier as well and these go together. Will open another PR once it's working.