The data we get from a rest API will be formatted in JSON
JSON (JavaScript Object Notation) is a lightweight data interchange format that uses key-value pairs to represent data.
In Swift, the Codable protocol is a powerful way to encode and decode data, making it easier to convert between your custom data types and formats like JSON.
if we send data to server use encodable cause we have to convert it t JSON. If we receive data from server we have to use decodable cause we are converting JSON to data.
In Swift we use convert to snake_case if we're using to get the value from json typed in camelCase. This method exists in JSONDecoder().
POST → sending data to server. Get → receiving data from server. PUT → update existing data. DELETE → delete existing data.