Hello since I can't send Json data to Asp.Net 5's API Services I use this Method That I found in StackOverflow:

```
var param = function (obj) {
        var query = '';
        var name, value, fullSubName, subName, subValue, innerObj, i;

        for (name in obj) {
            value = obj[name];

            if (value instanceof Array) {
                for (i = 0; i < value.length; ++i) {
                    subValue = value[i];
                    fullSubName = name + '[' + i + ']';
                    innerObj = {};
                    innerObj[fullSubName] = subValue;
                    query += param(innerObj) + '&';
                }
            }
            else if (value instanceof Object) {
                for (subName in value) {
                    subValue = value[subName];
                    fullSubName = name + '[' + subName + ']';
                    innerObj = {};
                    innerObj[fullSubName] = subValue;
                    query += param(innerObj) + '&';
                }
            }
            else if (value !== undefined && value !== null) {
                query += encodeURIComponent(name) + '=' + encodeURIComponent(value) + '&';
            }
        }
        return query.length ? query.substr(0, query.length - 1) : query;
    };

```

And I set:

```
'Content-Type': 'application/x-www-form-urlencoded'

```

But when I progressed to more complex models, This param method can't convert a data model like:

```
{ RoleStatuses: [{Role: "Admin", IsInRole: true}, {Role: "User", IsInRole: false}, ...], UserName: "MyUser" }

```

And when I receive this model in API Service, UserName is recognized but Array count = 0, When I want to send this data as json both UserName and the Array are null, I stuck in this situation and cannot go further, so please help.