Java: Display request of an HttpURLConnection before sending

前端 未结 3 2066
小鲜肉
小鲜肉 2020-12-15 18:30

I want to make some API calls to a server using HttpURLConnection. But the requests are not successful, returning:


  

        
3条回答
  •  我在风中等你
    2020-12-15 19:30

    tcpdump will work, but it can be hard to make it do what you want. NetCat is more user-friendly (here's the project page: http://netcat.sourceforge.net/ - most Unix platforms already include it).

    nc -l 9999
    

    This will listen on TCP port 9999, and when an HTTP client connects, it'll print out the full text of the request.

提交回复
热议问题