# I keep on getting "HTTP Status 400 – Bad Request" no matter what I do

**URL:** <https://forum.xwiki.org/t/i-keep-on-getting-http-status-400-bad-request-no-matter-what-i-do/16359>\
**Category:** Help / Discuss\
**Tags:** rest, xwiki\
**Created:** [January 30, 2025, 7:33am UTC](https://forum.xwiki.org/t/i-keep-on-getting-http-status-400-bad-request-no-matter-what-i-do/16359 "2025-01-30T07:33:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scantanader](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@scantanader](https://forum.xwiki.org/u/scantanader)\
**Post date:** [January 30, 2025, 7:33am UTC](https://forum.xwiki.org/t/i-keep-on-getting-http-status-400-bad-request-no-matter-what-i-do/16359/1 "2025-01-30T07:33:33Z")

</div>

Hello,

I am trying to automate a publishing pipeline involving multiple wikis (of the type XWiki and non). It should be able to interact with a single XWiki instance CRUDly. For this, I’d like to use the REST API. So, I am creating an XML document strictly following the schema [https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-model/src/main/resources/xwiki.rest.model.xsd](https://here) and then I do, based on the official docs, the following for testing purposes (the pipeline will build up the request programmatically, of course):

```bash
curl -u username:password 
       -X PUT 
       -H "Content-type: application/xml" 
       -H "Accept: application/xml" 
       -d "@newpage.xml"  
       https://<my-host>/rest/wikis/xwiki/spaces/<space1>/spaces/<space2>/pages/WebHome

```

where `<my-host>` is my host domain, `<space1>` an already existing space I’d like my resource to be part of and `<space2>` the resource I am trying to add, in this case a new page. Everything is URL-encoded. However, however I turn it (by tweaking here in there the namespace, for example), I keep on getting “HTTP Status 400 – Bad Request” with the following message:

```html
<!doctype html>
<html lang="en">
    <head>[...]</head>
    <body>
    <h1>HTTP Status 400 – Bad Request</h1>
    <hr class="line" />
    <p><b>Type</b> Status Report</p>
    <p><b>Message</b> Bad Request</p>
    <p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p>
    <hr class="line" />
    <h3>Apache Tomcat/9.0.98</h3>
  </body>
</html>

```

Any help is highly appreciated, thank you so much!
