I'm new to C# and I have a client request with a value which is base64 encoded. I'm trying to decode the string and make use of the JSON object. Here is the function I call to decode the base64 string.
public string FromBase64(string data)
{
if (string.IsNullOrEmpty(data)) return data;
var bytes = Convert.FromBase64String(data);
return UTF8Encoding.UTF8.GetString(bytes);
}
How can I convert the return value of this function or modify it to JSON so that I can parse its values?
For example, right now for the value of input value data e0tleSA6ICdhYmMnLCBpc0V4aXN0czogJ3RydWUnfQ==, the current output is "{Key : 'abc', isExists: 'true'}".
The output I want is {Key : 'abc', isExists: 'true'}