Horje
dotnet core ajax post of an ojject  site:stackoverflow.com Code Example
dotnet core ajax post of an ojject site:stackoverflow.com
$(document).ready(function () {
    var things = [
        { id: 1, color: 'yellow' },
        { id: 2, color: 'blue' },
        { id: 3, color: 'red' }
    ];      

    things = JSON.stringify({ 'things': things });

    $.ajax({
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        type: 'POST',
        url: '/Home/PassThings',
        data: things,
        success: function () {          
            $('#result').html('"PassThings()" successfully called.');
        },
        failure: function (response) {          
            $('#result').html(response);
        }
    }); 
});


public void PassThings(List<Thing> things)
{
    var t = things;
}

public class Thing
{
    public int Id { get; set; }
    public string Color { get; set; }
}




Javascript

Related
how to store array into react-native local storage Code Example how to store array into react-native local storage Code Example
redirect all request http to https express js Code Example redirect all request http to https express js Code Example
javascript regex wrap string Code Example javascript regex wrap string Code Example
javascript decode uri Code Example javascript decode uri Code Example
redirect http to https express js Code Example redirect http to https express js Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7