Bird
0
0

Which Swift type is commonly used to represent the response data from a GET request using async/await?

easy📝 Conceptual Q2 of 15
iOS Swift - Networking
Which Swift type is commonly used to represent the response data from a GET request using async/await?
AURLResponse
BData
CString
DInt
Step-by-Step Solution
Solution:
  1. Step 1: Identify response data type

    The response body from a GET request is usually raw bytes, represented by the Data type in Swift.
  2. Step 2: Eliminate other types

    URLResponse represents metadata, String is a possible decoded form, Int is unrelated.
  3. Final Answer:

    Data -> Option B
  4. Quick Check:

    Response data type = B [OK]
Quick Trick: GET response body is raw bytes as Data [OK]
Common Mistakes:
  • Confusing URLResponse with response body
  • Assuming response is always String
  • Using Int for response data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes