how to create 400 bad request so that I can verify

2019-07-22 11:15发布

currently I am doing a work to handle the 400 bad request status error. I am wondering how to create a request that server will return 400 status.

标签: http
2条回答
啃猪蹄的小仙女
2楼-- · 2019-07-22 11:48

A HTTP 400 error occurs due to bad syntax in the request.

To create a request that forces the server to return a 400 error, you can:

  1. Open a TCP connection to port 80 on your server
  2. Send junk
  3. Observe response.
查看更多
爷、活的狠高调
3楼-- · 2019-07-22 12:02

I found an easy way to generate 400 Bad Request Error:

Appending /% at the end of the URL should work for most websites.

For example:

http://abc.go.com/%
http://www.checkupdown.com/%
https://www.oath.com/%
https://www.apple.com/%

The above URLs generate the following page:

enter image description here

Note that this method doesn't work for ALL websites on the internet.

Since the server can decide what to do when seeing /%.

查看更多
登录 后发表回答