Dear Khaled, it would be great if could you provide us with some valid Java code. Otherwise, it will be rather difficult to keep track of the problem in reasonable time. Best regards, Christian ___________________________ On Sun, May 13, 2012 at 7:23 PM, khaled refai <khaled.refai@gmail.com> wrote:
String st = "<query xmlns='http://basex.org/rest'>"+ "<text> insert node <user> <name>qusai</name> "+ "<username>qu</username> <password>qu</password>"+ " </user> into //elib/users</text>"+ "<parameter name='wrap' value='yes'/></query>" conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/xml"); conn.setRequestProperty("Authorization", "Basic " + encoded);
out = conn.getOutputStream(); out.write(res.getBytes("UTF-8")); out.close(); System.out.println(conn.getResponseMessage());
and the result from server is : Bad Request ???? any answer