score:1

Accepted answer

i can't catch images on my react application. also i cant get arrays fields.

to achieve your requirement of posting data with file(s) and make the data can be bound to action parameter well, you need to do following modifications:

1)a parameterless constructor for class apirequest

[datacontract(name = "api-request"), serializable]
public class apirequest<t>
{
    public apirequest()
    {

    }
    public apirequest(t data, byte[] token)
    {
        //...

note: this doc shows deserialization behavior within system.text.json

2)dynamically generate and populate formdata like below

const data = new formdata();
//...
data.append('language', language_here);

//...
data.append('data.unitstock', unitstock_here);
data.append('data.productimages', productimage1_here);
data.append('data.productimages', productimage2_here);
//...

note: this doc explains what model binding is and how it works

3)to bind byte[] data, you may need to use the bytearraymodelbinder

test result

enter image description here


Related Query

More Query from same tag