Somehow when using Windows mode, I get an Exception Error"Reference to undeclared entity 'nbsp'. Line 69, position 41."" weird. Then when I check the result.Content after executing I get like an html page with errors like 401 - Unauthorized: Access is denied due to invalid credentials. This is an issue that happens on the IIS Server too.
Below is my RestSharp Code from ActionResult
- var client = new RestClient(Request.Url.GetLeftPart(UriPartial.Authority).ToString());
- var request = new RestRequest("http://domain.co.za/api/student/getBookedSlotHistory", Method.POST);
- request.AddHeader("cache-control", "no-cache");
- request.AddObject(new StudentInput()
- {
- StudentNumber = "219193029"
- });
-
- var result = client.Execute(request);
- var data = JsonConvert.DeserializeObject(result.Content);
Then below is my APIController
- [HttpPost]
- [Route("api/student/getBookedSlotHistory")]
- public async Task GetHistory(StudentInput input)
- {
-
- return await _studentRepository.GetBookingHistoryData(input);
- }