...
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
public string GetSessionId(string filename, string ruleSet) { var client = new RestClient(this.serverUrl + this.reportSessionsUrl"/congree/api/Linguistic/Reporting/v1/Sessions"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", "Bearer " + this.token); request.AddParameter("application/json", "{\n\"DocumentName\": \"" + filename + "\",\n\"RuleSet\": \"" + ruleSet + "\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); SessionIdObject id = JsonConvert.DeserializeObject<SessionIdObject>(response.Content); return id.SessionId; } |
...