Hi
I am trying an http call to get the input response..my strategy is i am calling httpcall from controller with a general url..i am facing some issues i am getting internal server error also i dont know my way is right please suggest me if i am wrong..
1.input parameter passing is right here?
2.I am getting server error because of this i dont know why? please help
my controller class and the url i am calling from postman is api/Details/Check this link i will put in postman and doing all
- [HttpPost("api/Details/Check")]
- public async Task Check([FromBody] details input)
- {
- var result = await _resultcheker .ResultCheckercall(input);
- }
- the call will goto ResultCheckercall
- public async Task Checkercall(CheckInput input)
- {
- CheckResults CheckInputResult = new yCheckResults();
- using (var httpClient = new HttpClient())
- {
- var content = new StringContent(JsonConvert.SerializeObject(input), Encoding.UTF8, "application/json");
- using (var response = await httpClient.PostAsync("https://localhost:5443/api/Alldetails/details", content))
- {
- string apiResponse = await response.Content.ReadAsStringAsync();
- CheckInputResult = JsonConvert.DeserializeObject(apiResponse);
- }
- }
- return yCheckInputResult;
- }