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
Aniket Narvankar
562
2.1k
604.9k
Asp.Net WebAPI Question
Jul 3 2016 8:27 AM
I am new to webApi,I have cratead a api method
[HttpPost]
public string Test(string Name,string LastName)
{
Register obj = new Register();
string Message = obj.Insert(Name,LastName);
return Message;
}
Register is the Model in that have following
public string Name
{
get;
set;
}
public string LastName
{
get;
set;
}
public string Insert(string Name,string Lastname)
{
string message;
//Database logic
return message;
//message is success if insertion successful otherwise fail
}
I am trying to Call the web api through Rest Client as follows
http://localhost:56611/api/Default1/Test
Default1 is controller name and Test is my method name.
Name: Abc
LastName: Xyz
Content-Type: application/json
But it is not working gives 404 bad request error this is the message
No action was found on the controller 'Default1' that matches the request.
Please do let me know about the solution how should i pass the parameters to web api from advanced rest client,i am new to this
Reply
Answers (
3
)
fix upload file button inside updatepanel
Need server's IP to be detected besides viewers by google