This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 60739
    
  65

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: 41034
    
  43
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: 60739
    
  65

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: 41034
    
  43
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: 41034
    
  43
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.
 
jQuery in Action, 2nd edition
 
subject: Send a http request with java to another server
 
Similar Threads
Sending HTTP POST from Server to another Server
How to access the IBM HTTP Server ??
redirecting from jsp without ignoring html statements
Cancel Ajax previous request
Using a servlet to initiate a request