I have a simple task. I want to read with RestSharp
an api. This api returns a JSON and I should save this JSON on a file.
var client = new RestClient($"https://ling.rapidapi.com/conjugate/?verb={verbString}");
var request = new RestRequest(Method.GET);
request.AddHeader("content-type", "application/json");
IRestResponse response = client.Execute(request);
System.IO.File.WriteAllText(Path.Combine(path, verbString + ".json"), response.Content);
If I inspect the result of this request I can see a JSON
but when I save the Content
in a file, I find that
- the file starts with "
- every " is saved as "
- characters such us <> are encode
Is there a way to save a clean JSON?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…