I have create a seprate web api project and another mvc4 project. When i am passing integer or string to web api its working fine and geting saved. But now i trying to pass comlex data to web api but i getting null in my project. My codes are.
MVC4...
readonly string uri = "http://localhost:1900/api/LoginApi";
public string RegisterIcaUser(StudentModel _StudentModel)
{
using (WebClient webClient = new WebClient())
{
string newUri = uri + "?SM=" + _StudentModel;
return JsonConvert.DeserializeObject<string>(webClient.DownloadString(newUri));
}
}
Web Api....
[HttpGet]
public string RegisterIcaUser([FromUri]StudentModel SM)
{
string strResult = "F";
return strResult;
}