I am creating an application for my thesis at college. So far I have done
HTTP Get Requests to exist sending XQuery queries, and so far it is working
However now I need to know how to make an HTTP Put Request to exist, to
store a XML file, using a java application. For the get request, I used th=
HttpURLConnection class, but so far I was not able to make the PUT request.
Any help will be appreciated.
From: Wolfgang Meier <wolfgangmm@gm...> - 2006-04-25 18:52:50
> However now I need to know how to make an HTTP Put Request to exist, to
> store a XML file, using a java application. For the get request, I used =
> HttpURLConnection class, but so far I was not able to make the PUT reques=
Here's an example:
HttpURLConnection connect =3D getConnection(RESOURCE_URI);
connect.setRequestProperty("Authorization", "Basic " + credentials);
Writer writer =3D new OutputStreamWriter(connect.getOutputStream(), "UTF-8"=
The complete code can be found in the class
org.exist.http.test.RESTServiceTest, contained in the source tree: