TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sujeet Raman
861
927
357.8k
How to send post parameter in httpclient in asp.net core 3.1?
Feb 3 2021 8:15 AM
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;
}
Reply
Answers (
10
)
how to scan and stored QR Code Image in sql database using asp.net
I installed SQLServer2012SP4