Java HttpURLConnection.getInputStream but get 401 IOException

后端 未结 2 909
有刺的猬
有刺的猬 2020-12-20 19:01

I am writing a REST client for CouchDB in Java. The following code should be quite standard:

    this.httpCnt.connect();
    Map respon         


        
2条回答
  •  孤城傲影
    2020-12-20 19:21

    See this question:

    "The HttpURLConnection.getErrorStream method will return an InputStream which can be used to retrieve data from error conditions (such as a 404), according to the javadocs."

提交回复
热议问题