fix java.net.SocketTimeoutException: Read timed out

前端 未结 2 1219
迷失自我
迷失自我 2020-12-25 15:21

I have a RESTful server which takes an http POST input from client to vote up songs on server. I have used Apache HTTPClient for client.

public boolean vote(         


        
2条回答
  •  长发绾君心
    2020-12-25 15:54

    I don't think it's enough merely to get the response. I think you need to read it (get the entity and read it via EntityUtils.consume()).

    e.g. (from the doc)

         System.out.println("<< Response: " + response.getStatusLine());
         System.out.println(EntityUtils.toString(response.getEntity()));
    

提交回复
热议问题