Java HttpClient to connect to RAM server
Hi,
I'm looking for a simple Java http client to be able to connect to a RAM server in order to read asset via REST API (OSLC). Does anyone has a code snippet to share to connect to a RAM server using the class org.apache.commons.httpclient.HttpClient? I'm trying to define a login method in a subclass of HttpClient such as
That would be greatly appreciated... Thanks in advance for sharing. |
3 answers
Hi, One way to do this is to go against the web services WAR where you can use BASIC authentication (instead of the FORM based auth I think you are trying to do here).
|
Thank you that worked fine - Can I use a FORM based authentication? If so what url should I specify in the GetMethod?
Thanks |
You can, but you will have to do the regular form based authentication dance. This includes handling redirects http://hc.apache.org/httpclient-3.x/redirects.html
A good way follow the flow, is to use something like Live Headers https://addons.mozilla.org/en-US/firefox/addon/3829 and follow the |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.