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

Extending PUT #20

Closed vinkcode closed 8 years ago

vinkcode commented 8 years ago

Hello Sacha,

Loving this library so far :-).

I'm quite a n00b to this and was hoping you could help me out with extending one of the functions:

What I essentially need is to extend ws.put to take different parameters, instead of params: [String : AnyObject], I would like it to take params: [String : Any]

I looked in the WS+Requests.swift but couldn't get it to work because the returned call function doesn't exist.

Reason I need this is because when I PUT a boolean as paramater, the AnyObject returns a 0 or a 1, while the API that I am putting to only takes true or false. The API i'm posting to is the philips Hue 2.0 bridge.

Looking very much forward to your replay :).

Kind Regards,

Andre Vink

s4cha commented 8 years ago

Hi Andre,

First of all thanks a lot for taking the time to write an issue. This definitely looks like something we want to fix on our side. I'm going to look into it and will let you know how it goes :)

Cheers,

s4cha commented 8 years ago

Indeed using Any instead of AnyObject seems to do the trick :) Question : are you planning to migrate to swift 3 anytime soon? Indeed, swift 3 version of ws is coming soon and it'll be easier for us to make that change at that time if you don't mind. Let me know,

vinkcode commented 8 years ago

Hi Sasha, that sounds like a good idea :-). I plan on moving to swift 3 so thats a good option. Thanks for your replay.

s4cha commented 8 years ago

Great @MadnessJax I'll try my best to be quick, hopefully this will be fixed this week :) Cheers,

s4cha commented 8 years ago

@MadnessJax I hope you're well. The change we talked about earlier is now live in the latest version (swift 3). That should solve your problem so let me know :)

s4cha commented 8 years ago

@MadnessJax closing this :)