gpt4 book ai didi

ajax - Extjs 4.2 : How to send parameters properly in a Ext. Ajax.Request POST

转载 作者:行者123 更新时间:2023-12-04 01:35:08 25 4
gpt4 key购买 nike

我必须从我的 ExtJs 脚本中执行 POST 以从我的数据库中删除某些内容:

Ext.Ajax.request({
url: 'deleteRole.html',
method: 'POST',
headers: {'Content-Type': 'text/html'},
waitTitle: 'Connecting',
waitMsg: 'Sending data...',
params: {
"rolename" : rolename
},
scope:this,
success: received,
failure: function(){console.log('failure');}
});
发送帖子时,我可以在 Firebug 中看到字体中的角色名称,但不是参数。我想向您展示另一篇关于用户注册的帖子(用 spring:form 制作)。如果我检查帖子,我可以看到以下内容:
image
(来源: subirimagenes.com)
我可以使用@RequestParam 在我的 Controller 中获取参数。
但是在我遇到问题的帖子中,我看不到参数部分,我只能看到 Font(Fuente) 部分:
image2
(来源: subirimagenes.com)
结果,我的 Spring Controller 没有检测到任何参数。我的帖子有问题吗?
谢谢

最佳答案

问题是您使用的是 headers: {'Content-Type': 'text/html'}, 行在你原来的问题中。这会将内容设置为 text/html 而不是发布数据的内容。

关于ajax - Extjs 4.2 : How to send parameters properly in a Ext. Ajax.Request POST,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17185814/

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