jjzjj

setDoInput

全部标签

Java:URLConnection中setDoInput的目的是什么

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:JavaHttpURLConnection例如,如果我想从我连接的服务器读取对POST方法调用的响应,是否会使用此方法?

java - HttpURLConnection 类的 setDoOutput 和 setDoInput 方法有什么用

我正在使用以下代码行调用POST网络服务。我不清楚connection.setDoOutput(true);和connection.setDoInput(true);能否详细说明这段代码的用途?我能否将相同的代码与GET一起使用?URLurl=newURL("http://xxxxxx.com");HttpURLConnectionconnection=(HttpURLConnection)url.openConnection();connection.setRequestMethod("POST");connection.setDoOutput(true);connection.se

java - Java HttpURLConnection 中 setDoInput 和 setDoOutput 的作用是什么?

HttpURLConnection.setDoInput和HttpURLConnection.setDoOutput的作用或目的是什么? 最佳答案 来自URLConnection的文档:SettheDoInputflagtotrueifyouintendtousetheURLconnectionforinput,falseifnot.Thedefaultistrue.SettheDoOutputflagtotrueifyouintendtousetheURLconnectionforoutput,falseifnot.Thedefa

java - Java HttpURLConnection 中 setDoInput 和 setDoOutput 的作用是什么?

HttpURLConnection.setDoInput和HttpURLConnection.setDoOutput的作用或目的是什么? 最佳答案 来自URLConnection的文档:SettheDoInputflagtotrueifyouintendtousetheURLconnectionforinput,falseifnot.Thedefaultistrue.SettheDoOutputflagtotrueifyouintendtousetheURLconnectionforoutput,falseifnot.Thedefa