Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

After which method java send real request to server?

 
Ivan Franko
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for example, I have next java code:


And I cant understand, in which moment (after call what method) java send real request to the server?
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The connection / request isn't made until the connect() method is called. The connect() method is called implicitly in the getInputStream() method. So in your call the HTTP request is made when you call the getInputStream() method.
 
Ivan Franko
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brilliant! Thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic