.net core 3.0 Coldairarrow swagger Post 404.15 查询字符串过长

<div class="content-container"> 
  <h3>HTTP Error 404.15 - Not Found</h3> 
  <h4>请求筛选模块被配置为拒绝包含的查询字符串过长的请求。</h4> 
</div> 
<div class="content-container"> 
 <fieldset><h4>最可能的原因:</h4> 
  <ul>     <li>Web 服务器上的请求筛选被配置为拒绝该请求,因为查询字符串过长。</li> </ul> 
 </fieldset> 
</div> 
<div class="content-container"> 
 <fieldset><h4>可尝试的操作:</h4> 
  <ul>     <li>确认 applicationhost.config 或 web.config 文件中的 configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString 设置。</li> </ul> 
 </fieldset> 
</div> 

 

别的不说了

1:检查项目下是否有web.config文件,没有的话创建

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <security>
        <requestFiltering>
          <requestLimits maxAllowedContentLength="52428800" maxQueryString="52428800"/>
        </requestFiltering>
      </security>
    </system.webServer>
  </location>
</configuration>

maxQueryString默认值为 2048.如果查询字符串的长度超过属性大小限制,ASP.NET 将返回 HTTP 400(错误请求)状态代码。

2:swagger测试是把参数拼接在url中,可以放到body里面

 

先这样

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值