A GET request is used to retrieve data from a server.
It does not send a request body and is used when the client only needs to fetch information.
Client → sends GET request → Server → returns data
In iOS, GET requests are performed using:
URLSession.shared.dataTask
The request is created using a URL or URLRequest.
var request = URLRequest(url: url)
request.httpMethod = "GET"
Even though GET is the default method, setting it explicitly improves clarity.
URLSession.shared.dataTask(with: request) { data, response, error in
// handle response
}.resume()