Web API complex parameter properties are all null

前端 未结 18 1509
长情又很酷
长情又很酷 2020-11-30 04:18

I have a Web API service call that updates a user\'s preferences. Unfortunately when I call this POST method from a jQuery ajax call, the request parameter object\'s proper

18条回答
  •  眼角桃花
    2020-11-30 04:59

    I ran into the same issue, the solution for me was to make certain the types of my class attributes matched the json atributes, I mean

    Json: "attribute": "true"
    

    Should be treated as string and not as boolean, looks like if you have an issue like this all the attributes underneath the faulty attribute will default to null

提交回复
热议问题