Quantcast
Channel: What exactly does URLConnection.setDoOutput() affect? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

What exactly does URLConnection.setDoOutput() affect?

$
0
0

There's setDoOutput() in URLConnection. According to documentation I should

Set the DoOutput flag to true if you intend to use the URL connection for output, false if not.

Now I'm facing exactly this problem - the Java runtime converts the request to POST once setDoOutput(true) is called and the server only responds to GET requests. I want to understand what happens if I remove that setDoOutput(true) from the code.

What exactly will this affect? Suppose I set it to false - what can I do now and what can't I do now? Will I be able to perform GET requests? What is "output" in context of this method?


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images