Basic networking
https://www.tutorialspoint.com/http/http_requests.htm
https://github.com/Alamofire/Alamofire
You should do the following:
- Read about HTTP requests.
- Read about JSON.
- Install Google Chrome and Postman extension.
- Execute
GET
request withhttp://gitlab.faifly.com/ios-general/ios-tutorial/uploads/75727472327ca7b210bb1d904438a2d7/tutorial.json
URL. You should see JSON with a list of organizations. - Create a new branch from develop called feature/basic_networking.
- Create a new class called
RequestManager
, which is subclass ofNSObject
. - Implement
fetchOrganizations
static method, which accepts one argument - a closure (block) with a single parameter -[String : AnyObject]
. It should send aGET
request to a URL specified above and return the response with the help of the closure. - Add a new button in
OrganizationInfoViewController
, called “Fetch organizations”. Upon tapping that button you should callfetchOrganizations
method fromRequestManager
, parse it into the database and present an action sheet with a list of organizations. After selecting an organization you should return toMainViewController
and its table should be reloaded with appropriate organization. Request should be done withAlamofire
. - Create a pull request.
You should be able to answer the following questions:
- What is an HTTP request?
- What is JSON?
- What data types does JSON support?
- What is an HTTP method?
- What HTTP methods do you know? What methods are the most common?
- What does an HTTP request consists of?
- What is Alamofire?