3

My code:

let json: [String: Any] = ...
request.httpBody = try JSONSerialization.data(withJSONObject: json, options: .withoutEscapingSlashes)

The problem is it works in iOS 13 only but I need to support iOS 12 too.

How to fix it correctly? Should I convert Data to String, replace "\/" with "/" and convert to Data back manually each time?

Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49

0 Answers0