I get a 400 bad request - invalid Url when the length of the request exceeds 320+ characters

后端 未结 2 1969
栀梦
栀梦 2021-02-05 19:13

Not sure what could be the reason. Added the following in Web.config also. maxUrlLength=\"1024\" maxQueryStringLength=\"1024\" requestPathInvalidCharacters=\"\" maxRequestLength

2条回答
  •  猫巷女王i
    2021-02-05 20:00

    Just documenting my experience:

    My issue was the one pointed by @Mark at the question comments:

    "by default the maximum url segment length is 260"

    He suggested to increase this limit in the registry, but I didn't want this kind of trouble. The suggestion by @Vignesh T worked better:

    "Replaced the url segment into a querystring parameter and it worked fine"

    In summary, instead of doing:

    http://path.to.website/very-long-string-goes-here/
    

    I just did:

    http://path.to.website/?key=very-long-string-goes-here
    

提交回复
热议问题