Jetty7 HttpClient POST problem

View: New views
1 Messages — Rating Filter:   Alert me  

Jetty7 HttpClient POST problem

by chazzs :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am having some problems crafting and sending a POST to a server via the HttpClient.  I have the Client set up as per the tutorial (http://wiki.eclipse.org/Jetty/Tutorial/HttpClient).  One thing is not clear.  How does one set the parameters for the post?  I am trying to implement a login for an application such that the application can use the same server side script to login as a web client.

I have tried setting the parameters through a call to setRequestContent() to no avail

         AbstractBuffer content = new ByteArrayBuffer("uname=user&pwd=password".getBytes("UTF-8"));
         exchange.setRequestContent(content);

is that the correct way to send POST parameters?  The server side script does not find any parameters.

Thanks for any help.

-chazzs