Created
May 16, 2016 13:15
-
-
Save mkorman/9b8d0ae408d04fa8433567d9c42d1ad6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public string Query (string soqlQuery) | |
{ | |
using (var client = new HttpClient()) | |
{ | |
string restRequest = InstanceUrl + API_ENDPOINT + "query/?q=" + soqlQuery; | |
var request = new HttpRequestMessage(HttpMethod.Get, restRequest); | |
request.Headers.Add("Authorization", "Bearer " + AuthToken); | |
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); | |
request.Headers.Add("X-PrettyPrint", "1"); | |
var response = client.SendAsync(request).Result; | |
return response.Content.ReadAsStringAsync().Result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment