I am completely new to coding, bear with me if I make any stupid presumptions about this code I learnt through a youtube video. I am querying Salesforce through REST API and my response has been converted to a string. PART 1: I want to print it in pretty print JSON format and PART 2: store the JSON data into an object.
I haven't tried zilch yet but I am looking at some previous answers on this forum.
HttpClient apiCallClient = new HttpClient();
String restCallURL = serviceUrl + "/services/data/v45.0/query?q=SELECT+Id,PAL_ID__c+FROM+Account";
HttpRequestMessage apirequest = new HttpRequestMessage(HttpMethod.Get, restCallURL);
apirequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
apirequest.Headers.Add("authorization","Bearer " + authToken);
HttpResponseMessage apiCallResponse = await apiCallClient.SendAsync(apirequest);
String requestresponse = await apiCallResponse.Content.ReadAsStringAsync();
Console.WriteLine(requestresponse);
Console_textBox.AppendText(requestresponse);
Just need in Pretty Print JSON on my console and to store that data in an object.