From: Peng Yu <pen...@gm...> - 2011-10-30 20:48:20
|
On Sun, Oct 30, 2011 at 3:35 PM, Anton Kolev <ak...@de...> wrote: > On 30.10.2011 20:47, Peng Yu wrote: >> >> I get the following error. Did you get it working? Or there is >> something wrong with my installation? > > Yes (with appropriate user, password and base collection) > >> >> /tmp$ curl --include \ >>> >>> --user peng:peng-passwrod \ >>> --header "Content-Type: text/xml" \ >>> --request PUT \ >>> --data '<peng-test ix="1"/>' \ >>> http://127.0.0.1:8080/exist/rest/db/peng-test/new-collection/test01.xml >> >> HTTP/1.1 401 Unauthorized > > "Unauthorized" means that you not have replaced peng:peng-passwrod with > username and password for user which is allowed to write in last (innermost) > pre-existing collection in the resource URL. > > To get the sample working, using admin interface: > > http://127.0.0.1:39125/exist/admin > > you can create user peng with password peng-passwrod and home collection > peng-test and retry PUT request. I forget to replace passwork and username, Now it works. I see what I was wrong. samples/http/httpclient.pl -u admin -p FyDi3QfBON -c /db/XQuery_Walmsley2007.ex/chapter02 catalog.xml should be (with -s) samples/http/httpclient.pl -u admin -p FyDi3QfBON -c /db/XQuery_Walmsley2007.ex/chapter02 -s catalog.xml -- Regards, Peng |