I am having problem in mvc 4 web api (c#)
I have a following web api controllor and action
public abcapicontroller:apicontroller
{
public IEnumerable<viewmodel> pqrAction(int id,string CustName,datetime BillDate)
{
------------ some code
Return jsonobject;
}
}
My problem is
1. I want to call web api from web browser address bar as
http://localhost:protno/api/abcapi/pqrAction/1/Ram/2014-02-21T23:51:32:031Z
Where
api/C***rollerName/ActionName/id/CustName/Datetime(universal)
In web browser address bar 2014-02-21T23:51:32:031Z format not working (only 2014-02-21 working)
2. and want to use above url in jquery post as follows
function GetCustomerDetail() {
jQuery.support.cors = true;
var CustData= {
ID: 1,
CustName: "Ram",
BillDate: "2014-02-21T23:51:32:031Z"
};
$.ajax({
url: 'http://localhost:protno/api/abcapi/pqrAction',
type: 'POST',
data:JSON.stringify(employee),
contentType: "application/json;charset=utf-8",
success: function (CustData) {
do some thing
},
error: function (x, y, z) {
}
});
}
How can I Achieve my task any url routing pattern or other i need to do ..... ? please help me.
with Regards,
Manoj