setDoOutputtrue
setDoOutput(true) is a method of java.net.URLConnection and its subclass HttpURLConnection. It signals that the application intends to use the connection for output, i.e., to send data to the remote resource. This flag is commonly used when performing requests that include a body, such as POST or PUT.
When setDoOutput(true) is in effect, the typical usage pattern is to obtain an OutputStream via getOutputStream
If the chosen request method or protocol does not support a request body, attempting to obtain or
In summary, setDoOutput(true) enables sending a body with a URL connection, signals the intent to output data,