title: swift JSON login REST with post and get response example
body: <p>It's my first experience with REST in iOS development with swift. I couldn't find any working or straight (simple) example for doing what i need here.</p>
  
  <p>I have a login backend (<a href="https://myaddress.com/rest/login" rel="noreferrer">https://myaddress.com/rest/login</a>), where I need to pass 2 params: login and password. When I pass good values (user exists in database) I get 2 variables as a result: token (string) and firstLogin (bool). So when I get those values I know that login is successful and I can log in into my app.</p>
  
  <p>So I am begging you for an example (just a simple function) of how to achieve that. If I get working code example I will know how to use it for other rest services in my app. I tried many solutions from tutorials I found, but any of them was working for me.. So to not waste my time searching I would like someone experienced to show me the way to achieve that.</p>
  
  <p>I am not sure if Alamofire is so good to use, I know that swift 4 has it's own build neetwork services and to work with json. Any solution that works would be great.</p>
  
  <p>Also, side question - if I would prefer to use Alamofire, do I need to use swiftyJSON also? Or it's just for parsing?</p>