Results 1 to 1 of 1
- 04-30-2011, 06:11 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
Problem with response from PostMethod
Hello,
Posting from a form by
and doing it via PostMethodJava Code:<form action="http://somewhere.com" method="post"> <input type="hidden" name="params" value="<some xml>" /> <input type="submit" value="submit" /> </form>
Java Code:try{ PostMethod post = new PostMethod("http://somewhere.com"); post.addParameter("params", "<some xml>"); HttpClient client = new HttpClient(); int status = client.executeMethod(post); } catch (Exception e){ out.print("ERROR "); e.printStackTrace(out); } finally{ out.close(); }
yields a different result. By PostMethod the response is sort of captured and I can output it with out.print, but instead I would like to open the response page on the source server as a page. Is it possible to simulate the form/post behaviour on the PostMethod and HttpClient?
Similar Threads
-
get-response problem (snmp4j)
By easymod in forum NetworkingReplies: 1Last Post: 09-28-2011, 08:23 AM -
SOAP|Java Response - IOException| Server response - a:System.Net.WebException
By bornster in forum XMLReplies: 0Last Post: 04-07-2011, 03:09 PM -
Problem using postmethod
By Bougey in forum New To JavaReplies: 4Last Post: 12-02-2010, 07:25 PM -
Problem to return XML structured WebMethod response
By Olegus in forum Advanced JavaReplies: 1Last Post: 08-31-2010, 10:16 AM -
response.sendRedirect problem
By christina in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 08-03-2007, 05:23 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks