Bad Request, Your browser sent a request that this server could not understand

后端 未结 10 933
没有蜡笔的小新
没有蜡笔的小新 2020-12-13 13:12

There are two application servers and a switch. When i access application by using application server ip it works fine. However if i use switch ip in my url Bad request erro

相关标签:
10条回答
  • 2020-12-13 14:09

    I got Bad Request, Your browser sent a request that this server could not understand when I tried to download a file to the target machine using curl.
    I solved it by instead using scp to copy the file from the source machine to the target machine.

    0 讨论(0)
  • 2020-12-13 14:12

    Make sure you url encode all of the query params in your url.

    In my case there was a space ' ' in my url, and I was making an API call using curl, and my api server was giving this error.

    Means the following url http://somedomain.com?key=some value with space

    should be http://somedomain.com/?key=some%20value%20with%20space

    0 讨论(0)
  • 2020-12-13 14:14

    In my case is a cookie-related issue, I had many cookies with value extremely big, and that was causing the problem.

    You can replicate this issue here on stackoverflow.com, just open the console and type this:

    [ ...Array(5) ].forEach((i, idx) => {
        document.cookie = `stackoverflow_cookie${idx}=${'a'.repeat(4000)}`;
    });
    

    What is that?

    I am creating 5 cookies with a string of length or value of 4000 bytes; then reload the page and you will see the same issue.

    I tried it on google.com and you'll get the error but they automatically clear the cookies for you, which is a nice fallback to start fresh.

    0 讨论(0)
  • 2020-12-13 14:15

    in my case:

    in header

    Content-Typespacespace

    or

    Content-Typetab

    with two space or tab

    when i remove it then it worked.

    0 讨论(0)
提交回复
热议问题