asp.net webapi 2 post parameter is always null

前端 未结 2 1808
抹茶落季
抹茶落季 2021-01-24 23:39

I have been trying to figure this our for the last hour, but I can\'t see what\'s wrong with it

the post is from a xamarin app that I\'m writing, using restsharp portabl

2条回答
  •  迷失自我
    2021-01-24 23:50

    related entry from this link

    in short, when sending simple values which are to be picked up using [frombody] attribute on the server side, you have to prefix the value with = e.g. =testValue

    but its probably better just to use JSON Objects and object bindings on the API, even for simple values

提交回复
热议问题