I am having a problem sending 2 particular objects to the server.
I have a form with an input and a text area
Sendfunction SendServer() { $.ajax({
url: '/api/Service', type: "POST", contentType: 'application/json', data: {} //!!! success: function (response) { }, error: function (er) { } });}
the issue is that my text area will contain an user input json of the form:
{
"list": [
{
"name": "john smith",
"lastaccess": "2016-01-01T07:21:31 -00:00"
},
{
"name": "paul marley",
"lastaccess": "2016-01-01T07:22:31 -00:00"
}
]
}
I need to send both values to the server:
public class ServiceController : ApiController
{
public string Post( *something* )
{}
}
I can reach the server, but I donno how to properly send the 2 objects so I can retrieve them on the server?
I have been trying a lot of options, nothing worked :(