This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Send a http request with java to another server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Send a http request with java to another server" Watch "Send a http request with java to another server" New topic
Author

Send a http request with java to another server

Sarra Sakka
Ranch Hand

Joined: Jul 12, 2013
Posts: 272
I just want know how can i send a http request to another server (Pc) in the same network.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61450
    
  67

Check out the URL and URLConnection classes in java.net. Or explore tools like HttpClient.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sarra Sakka
Ranch Hand

Joined: Jul 12, 2013
Posts: 272
I use the hhtpClient tools in the servlet or where ??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42367
    
  64
You can use it in any class you like.


Ping & DNS - my free Android networking tools app
Sarra Sakka
Ranch Hand

Joined: Jul 12, 2013
Posts: 272
I have a confusion, can you help me please
When i send a request to another server(another PC), how does it know he has received a request ??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61450
    
  67

It is listening on the appropriate port.
Sarra Sakka
Ranch Hand

Joined: Jul 12, 2013
Posts: 272
I haven't yet understood
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42367
    
  64
Are you familiar with client /server communication? How about HTTP?
Sarra Sakka
Ranch Hand

Joined: Jul 12, 2013
Posts: 272
yes, I have an idea about this, but no many thing
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42367
    
  64
That being the case, what, exactly, did you understand, and what, exactly, did you not understand? Forums are unsuitable for lengthy tutorials on these matters, so it's important for us to understand what you're missing.
charles ross
Greenhorn

Joined: Mar 31, 2014
Posts: 1
You probably want to learn HttpUrlConnection. So do I.
 
wood burning stoves
 
subject: Send a http request with java to another server