gpt4 book ai didi

Grails 使用来自 POST 请求的 XML 填充参数

转载 作者:行者123 更新时间:2023-12-02 08:32:06 24 4
gpt4 key购买 nike

我有一个通过 grails Controller 公开的 RestFull grails api。我需要自动绑定(bind) POST 请求中发送的 xml 数据。我认为使用 groovy bindData(object,params) 不起作用,因为 params 引用似乎没有 xml 元素。我在 UrlMappings 中使用 parseRequest=trueparams 对象没有 xml 元素。

我是否缺少一些其他配置,以便我的 params 对象自动填充 xml body 元素?

最佳答案

看来正确的方法是使用:

request.reader.text

获取原始 xml。其他方法对我来说并不成功。

关于Grails 使用来自 POST 请求的 XML 填充参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11102646/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com