直接看SDK java.net.URLConnection
- java.lang.Object
-
- java.net.URLConnection
-
- java.net.HttpURLConnection
-
setDoInput
public void setDoInput(boolean doinput)
Sets the value of thedoInput
field for thisURLConnection
to the specified value.A URL connection can be used for input and/or output. Set the DoInput flag to true if you intend to use the URL connection for input, false if not. The default is true.
-
Parameters:
-
doinput
- the new value.
Throws:
-
IllegalStateException
- if already connected
See Also:
-
doInput
,getDoInput()
-
-
setDoOutput
public void setDoOutput(boolean dooutput)
Sets the value of thedoOutput
field for thisURLConnection
to the specified value.A URL connection can be used for input and/or output. Set the DoOutput flag to true if you intend to use the URL connection for output, false if not. The default is false.
-
Parameters:
-
dooutput
- the new value.
Throws:
-
IllegalStateException
- if already connected
See Also:
-
getDoOutput()
-
setDoInput(boolean doinput)如果你打算输入,则设置为ture,否则false。默认truesetDoOutput(boolean dooutput)如果你打算输出,则设置为true,否则false。默认false