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

setHeaders

Brett Lewinski
Greenhorn

Joined: Feb 22, 2008
Posts: 19
I am new to groovy and I am trying to call a RESTful service. This service requires the setting of remote_user in the header. I am not having much success in getting this set. Has anyone done this before and I would appreciate any guidance or samples.

Thanks in advance!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

How are you making the service call?
Brett Lewinski
Greenhorn

Joined: Feb 22, 2008
Posts: 19
David -

Thanks for the reply! Since I am new to groovy I found a sample service call to Google and I have been modifying it for what I need. I am actually trying to create this as a portlet for one of our portals; the portlet will allow a user to search our Service Bus and get some results displayed back in the portlet. Any thoughts or guidance in this area would be appreciated as well!

Here is my code so far:

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

http://groovy.codehaus.org/HTTP+Builder
Brett Lewinski
Greenhorn

Joined: Feb 22, 2008
Posts: 19
David -

Not sure how I missed that page, thanks for the link.

I think I have the header set, how can I verify it is set? I tried using request.getAllHeader() to show what is in it but it looks empty.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: setHeaders
 
Similar Threads
(java.net.ConnectException) caught when processing request: Connection refused
Java-Generic Interface
how to consume webservice in Axis
Volunteers wanted
windows service type application in Java