提交JSON数据时出现400错误的请求 [英] 400 bad request while submitting json data

查看:467
本文介绍了提交JSON数据时出现400错误的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用jquery将json数据从客户端传递到服务器时,我得到400 Bad Request.从Firebug查看json数据时,显示如下:

"NetworkError:400错误请求-http://localhost:61153/Handlers/CENTRALLOOKUP/RelationTypeHandler.ashx?_ = 1402013961605&method = SaveRelationType&args =%22%5B%7B%5C%22RelTypeID%5C%22%3A1%2C%5C% 22RelTypeName%5C%22%3A%5C%22fdg%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22dfg%5C%22%2C%5C%22Status%5C%22%3Atrue%2C% 5C%22FromDate%5C%22%3A%5C%222070.02.02%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID% 5C%22%3A3%2C%5C%22RelTypeName%5C%22%3A%5C%22Father1%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22Father1%5C%22%2C%5C% 22Status%5C%22%3Afalse%2C%5C%22FromDate%5C%22%3A%5C%222070.02.02%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22% 7D%2C%7B%5C%22RelTypeID%5C%22%3A7%2C%5C%22RelTypeName%5C%22%3A%5C%22Mother%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C% 22母亲%5C%22%2C%5C%22Status%5C%22%3Atrue%2C%5C%22FromDate%5C%22%3A%5C%22C0.0.8%8%C%22%2C%5C%22Action%5C%22% 3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A8%2C%5C%22RelTypeName%5C%22%3A%5C%22relation%5C%22%2C%5C% 22RelTypeNameEng%5C%22%3A%5C%22rela tion%5C%22%2C%5C%22Status%5C%22%3Afalse%2C%5C%22FromDate%5C%22%3A%5C%222070.02.02%5C%22%2C%5C%22Action%5C%22% 3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A9%2C%5C%22RelTypeName%5C%22%3A%5C%22fdg%5C%22%2C%5C% 22RelTypeNameEng%5C%22%3A%5C%22dfg%5C%22%2C%5C%22Status%5C%22%3Atrue%2C%5C%22FromDate%5C%22%3A%5C%22C0.02.02%5C%22% 2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A10%2C%5C%22RelTypeName%5C%22%3A%5C% 22dfgdf%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22dfgfd%5C%22%2C%5C%22Status%5C%22%3Atrue%2C%5C%22FromDate%5C%22%3A% 5C%22207003%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A15%2C%5C%22RelTypeName% 5C%22%3A%5C%22fdg%5C%22%2C%5C


我迫切需要帮助.在此先感谢

When passing json data from client to server using jquery , i getting 400 Bad Request . When viewed json data from firebug it show to be as below :

"NetworkError: 400 Bad Request - http://localhost:61153/Handlers/CENTRALLOOKUP/RelationTypeHandler.ashx?_=1402013961605&method=SaveRelationType&args=%22%5B%7B%5C%22RelTypeID%5C%22%3A1%2C%5C%22RelTypeName%5C%22%3A%5C%22fdg%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22dfg%5C%22%2C%5C%22Status%5C%22%3Atrue%2C%5C%22FromDate%5C%22%3A%5C%222070.02.02%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A3%2C%5C%22RelTypeName%5C%22%3A%5C%22Father1%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22Father1%5C%22%2C%5C%22Status%5C%22%3Afalse%2C%5C%22FromDate%5C%22%3A%5C%222070.02.02%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A7%2C%5C%22RelTypeName%5C%22%3A%5C%22Mother%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22Mother%5C%22%2C%5C%22Status%5C%22%3Atrue%2C%5C%22FromDate%5C%22%3A%5C%222070.09.08%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A8%2C%5C%22RelTypeName%5C%22%3A%5C%22relation%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22relation%5C%22%2C%5C%22Status%5C%22%3Afalse%2C%5C%22FromDate%5C%22%3A%5C%222070.02.02%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A9%2C%5C%22RelTypeName%5C%22%3A%5C%22fdg%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22dfg%5C%22%2C%5C%22Status%5C%22%3Atrue%2C%5C%22FromDate%5C%22%3A%5C%222070.02.02%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A10%2C%5C%22RelTypeName%5C%22%3A%5C%22dfgdf%5C%22%2C%5C%22RelTypeNameEng%5C%22%3A%5C%22dfgfd%5C%22%2C%5C%22Status%5C%22%3Atrue%2C%5C%22FromDate%5C%22%3A%5C%22207003%5C%22%2C%5C%22Action%5C%22%3A%5C%22%5C%22%7D%2C%7B%5C%22RelTypeID%5C%22%3A15%2C%5C%22RelTypeName%5C%22%3A%5C%22fdg%5C%22%2C%5C


I am urgently in need of help . Thank in advance

推荐答案


web.config system.webServer部分并设置httpErrors existingResponse属性

web.config system.webServer section and set httpErrors existingResponse attribute
<system.webserver>
    ...
    <httperrors existingresponse="PassThrough"></httperrors>
    ...
</system.webserver> 



经典的CustomErrors行为,因为我正在将localhost与远程服务器进行比较
第一个不会解释我的其他一些身份验证错误"是如何通过完整的

请参阅文章
how-to-use-http- iis中的detail-errors-a [



The classic CustomErrors behaviour because I was comparing localhost with a remote server
and the first wouldn''t explain how some of my other Authentication ''errors'' were getting through intact

See the article
how-to-use-http-detailed-errors-in-iis[^]


这篇关于提交JSON数据时出现400错误的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆