'gzip compression for API call in Swift
I'm working in Swift with an API that requires you to send JSON compressed using gzip or deflate in the body of your HTTP request. How would I convert testEventModel below into the required compressed JSON format?
struct EventModel: Codable {
var eventType: String
var eventName: String?
}
var testEventModel = EventModel(eventType: "TestEvent", eventName: "TestName")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|