草庐IT

frombodyattribute

全部标签

c# - 同时读取 FromUri 和 FromBody

我在webapi中有一个新方法[HttpPost]publicApiResponsePushMessage([FromUri]stringx,[FromUri]stringy,[FromBody]RequestRequest)请求类是这样的publicclassRequest{publicstringMessage{get;set;}publicboolTestingMode{get;set;}}我正在使用PostBody查询localhost/Pusher/PushMessage?x=foo&y=bar:{Message:"foobar",TestingMode:true}我错过了什

c# - 同时读取 FromUri 和 FromBody

我在webapi中有一个新方法[HttpPost]publicApiResponsePushMessage([FromUri]stringx,[FromUri]stringy,[FromBody]RequestRequest)请求类是这样的publicclassRequest{publicstringMessage{get;set;}publicboolTestingMode{get;set;}}我正在使用PostBody查询localhost/Pusher/PushMessage?x=foo&y=bar:{Message:"foobar",TestingMode:true}我错过了什