java.io.IOException: Server returned HTTP response code: 500

后端 未结 6 2163
太阳男子
太阳男子 2020-12-14 19:04

I\'m facing this problem with Java. I want to get some HTML informations from a URL. This code was working for so long, but suddenly, it stopped working.

When I acce

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 19:33

    I have encountered the same problem and found out the solution.

    You may look within the first server response and see if the server sent you a cookie.

    To check if the server sent you a cookie, you can use HttpURLConnection#getHeaderFields() and look for headers named "Set-Cookie".

    If existing, here's the solution for your problem. 100% Working for this case!

    +1 if it worked for you.

提交回复
热议问题