Last active
January 20, 2026 15:48
-
-
Save pmalicki11/c87deac66b81e6252c931100a4fd0d46 to your computer and use it in GitHub Desktop.
Classic UI Rest Call
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
| // Add references | |
| // 1. Newtonsoft.Json.dll | |
| // 2. Epicor.Ice.Lib.RestClient | |
| using Ice.Lib.RestClient; | |
| using System.Net; | |
| using System.Net.Http; | |
| using Newtonsoft.Json.Linq; | |
| private void CheckSomething() | |
| { | |
| IRestClient restClient = new RestClientBuilder().UseSession(oTrans.CoreSession).Build(); | |
| HttpResponseMessage response = restClient.Function.Post("Library", "Function", new RestContent(new {Input = "value"})); | |
| if (response.StatusCode == HttpStatusCode.OK) | |
| { | |
| var jObject = response.GetJsonResult() ?? new JObject(); | |
| bool isActive = jObject.ContainsKey("IsActive") && jObject["IsActive"].Type == JTokenType.Boolean && (bool)jObject["IsActive"]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment