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
Rupesh Kahane
102
19.1k
4.2m
getting Internal Server Error when call a Web API by async
Nov 7 2016 7:13 AM
I have created an Web API application.
This application I have hosted on one server.
Now I am calling a post method of that (hosted ) application using async call in another application, so If I put a debugger then I am getting an Internal Server Error when call a Web API by async.
Bellow is my code
public async void PostRequest(string name)
{
try
{
string name = "rupesh";
Uri requestUri = new Uri("http://xxxxx:2565/api/Registration/SignUp"); //replace your Url
string json = "";
json = Newtonsoft.Json.JsonConvert.SerializeObject(name);
var objClint = new System.Net.Http.HttpClient();
System.Net.Http.HttpResponseMessage respon = await objClint.PostAsync(requestUri, new StringContent(json, System.Text.Encoding.UTF8, "application/json"));
string responJsonText = await respon.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
var er = ex.Message.ToString();
}
}
Give me some solution.
Thanks
Reply
Answers (
3
)
MVC(with code first approch) using Mysql DB is problematic?
Some time the same message. Need to resolv...