网页API获取方法与复杂的对象作为参数 [英] Web API Get Method with Complex Object as Parameter
问题描述
如何发送一个复杂的对象(可能有庞大的数据)到一个Web API获取方法?
我知道我可以用户FromUri'选项,但由于数据量过大我不能使用该选项。我想用户FromBody选项。但我可以发布数据到一个GET方法?????
请指引我在这里...在此先感谢
如何将一个复杂的对象(可能有庞大的数据)发送到Web API获取方法?
块引用>您不能。 GET方法没有请求主体。你必须发送其中有局限性的查询字符串的一切。
您应该使用POST。
How to send a Complex Object( Which may have huge data) to a Web API Get Method? I know I can user 'FromUri' option, but since the data is too large I can't use that option. I want to user 'FromBody' option. But can I post data to a Get Method?????
Please guide me here...thanks in advance
解决方案How to send a Complex Object( Which may have huge data) to a Web API Get Method?
You can't. GET methods do not have request body. You have to send everything in the query string which has limitations.
You should use POST instead.
这篇关于网页API获取方法与复杂的对象作为参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!