JSONDecoder

In this tutorial, you will learn how to send HTTP Post Request in Swift and how to read HTTP Response and Response Body. This tutorial will cover: Send HTTP Post Request, Convert Query String request parameters to JSON, Convert Swift structure to JSON, Set HTTP Request Headers, Read HTTP Response, Read HTTP Response Headers, Read HTTP…

Read More HTTP POST Request Example in Swift

In this short tutorial, you will learn how to convert JSON string to a struct or a class in Swift. JSON String Let’s assume we have a web service endpoint which returns us a JSON string containing the following user details: {“firstName”:”Sergey”,”lastName”:”Kargopolov”,”email”:”[email protected]”,”userId”:”7fc0631b-7116-4d41-8d87-78f97b4dc543″} Swift Data Structure. Conforming to Codable or Encodable. We need to write Swift code…

Read More Convert JSON to Swift Class or Struct