File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Http  Post Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Http  Post" Watch "Http  Post" New topic
Author

Http Post

Archana Annamaneni
Ranch Hand

Joined: Jan 29, 2003
Posts: 147
I am doing a http post from java application to a url.Everything works fine ,the problem is the URL where I am sending the post has been changed and it is redirecting it to the new url on a network level.It seems the request is going to the url but all the data I am sending in the http post seems to be lost.Without chnaging the URl in my application is there any way I can send my request to the new url successfully?

Thanks
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Moving to Sockets and Internet Protocols


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42599
    
  65
Probably not. If the server is initiating a client-side redirect, then the post parameters are lost. Why don't you want to change the URL in your app?


Ping & DNS - my free Android networking tools app
Archana Annamaneni
Ranch Hand

Joined: Jan 29, 2003
Posts: 147
Thanks for the reply.The problem our production servers url has been changed , we don't want all our customers to change their URL.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Are you able to look for the 302 error code and the Location header and resend the information to the specified URL from your code?
Archana Annamaneni
Ranch Hand

Joined: Jan 29, 2003
Posts: 147
NoI didn't do any changes to the code , doing the redirect on a network level .Do you thinkI should read the post and and do a post to thenew url again ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Http Post