<
From version < 10.5 >
edited by Silvia Macovei
on 2009/10/08
To version < 10.6 >
edited by Silvia Macovei
on 2009/10/12
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -68,7 +68,7 @@
68 68  
69 69  If you use this approach (Apache HTTP Client + JAXB) you will find yourself writing some code like this:
70 70  
71 -{{code}}
71 +{{code language="none"}}
72 72  HttpClient httpClient = new HttpClient();
73 73  JAXBContext context = JAXBContext.newInstance("model.package");
74 74  unmarshaller = context.createUnmarshaller();
... ... @@ -86,7 +86,7 @@
86 86  
87 87  By using curl, the previous example would have been:
88 88  
89 -{{code}}
89 +{{code language="none"}}
90 90  $ curl http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/WebHome
91 91  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
92 92  <page xmlns="http://www.xwiki.org">
... ... @@ -105,7 +105,7 @@
105 105  
106 106  So if you have, let's say a Main.PrivatePage, and you try to do:
107 107  
108 -{{code}}
108 +{{code language="none"}}
109 109  $ curl -v http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
110 110  ...
111 111  < HTTP/1.1 401 Unauthorized
... ... @@ -116,7 +116,7 @@
116 116  
117 117  On the contrary, by specifying Admin credentials you gain access to the actual page:
118 118  
119 -{{code}}
119 +{{code language="none"}}
120 120  $ curl -u Admin:admin http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/PrivatePage
121 121  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
122 122  <page xmlns="http://www.xwiki.org">
... ... @@ -135,7 +135,7 @@
135 135  
136 136  For example, in order to create a page you might do the following:
137 137  
138 -{{code}}
138 +{{code language="none"}}
139 139  $ curl -u Admin:admin -X PUT -d "@newpage.xml" -H "Content-Type: application/xml" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage
140 140  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
141 141  <page xmlns="http://www.xwiki.org">
... ... @@ -154,7 +154,7 @@
154 154  
155 155  Where newpage.xml is an XML file containing
156 156  
157 -{{code}}
157 +{{code language="none"}}
158 158  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
159 159  <page xmlns="http://www.xwiki.org">
160 160   <title>Hello world</title>

Get Connected