I receive a response from an API call and handle the response with three cases.
- Failure
- Failed because the actions were already performed
- Success
I handle the case with "Failed due to previous completed actions" as a success.
The response with this case returns a string that I need to parse a JSON object from is as such
Failed ID is already closed {"ID":"0",system":"","user":"","secondaryID":"","date":"0001-01-01T00:00:00","currency":"USD"} What is the best way to retrieve the JSON object from the given API response? I have attempted to use the below line of code to parse the object from the given 'response' string. The number of the proceeding characters to the JSON object will be variable in length.
AlreadyCompleteModel jsonObj = JsonConvert.DeserializeObject(response); I appreciate a suggestion for a solution that will provide a string that can be parsed with the below line of code
JsonConvert.DeserializeObject(response);
Источник: https://stackoverflow.com/questions/780 ... son-object
Мобильная версия