0

I'm working on an app that uses cookies after login. I've implemented logging in part. Now I'll use apis to get data. I've two questions.

First, I understand parameters section in post request, that's your data. But why do I need one in get request and what should I write in them? Can you give any example? I've read about it but I really couldn't get it.

Second, after login, cookie should be added to GET requests as far as I'm concerned. Yet, I couldn't find out where to add cookie in Alamofire syntax and failed to find any example. Where should I add cookie?

Alamofire.request(url, method: .get, parameters: parameters, encoding: JSONEncoding.default)
Yazgan
  • 151
  • 11
  • "But why do I need one in get request and what should I write in them?" Because GET can also have parameters. For instance in Apple Documentation: `https://developer.apple.com/documentation/foundation/nsstring/1407339-initwithbytes?language=objc`, the `?language=objc` is a common way of giving parameters in a GET Request. – Larme Jul 13 '18 at 12:42
  • May be you can look for here : https://stackoverflow.com/a/43977128/2677551 – Van Jul 13 '18 at 13:05

0 Answers0