Last active
November 14, 2019 02:02
-
-
Save robertmryan/03542e2da539ad7f51c2540bafdad97e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Cost: Codable { | |
let id: String | |
let label: String | |
let value: String | |
} | |
let cost = Cost(id: "something", label: "something", value: "something") | |
let jsonData = try! JSONEncoder().encode(cost) // this works fine | |
let object = try! JSONSerialization.jsonObject(with: jsonData) // this works fine |
in 2 case of web services the response is simple text not a json, something like "the task done", my issue is when I intent to get this responses the " request " function returns myJSONError, how can I modify this class to return a simple string response?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have APIClient in my project and this is the code: