Quantcast
Channel: XWiki Forum - Latest topics
Viewing all articles
Browse latest Browse all 1220

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

$
0
0

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 and then I do, based on the official docs, the following for testing purposes (the pipeline will build up the request programmatically, of course):

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:

<!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!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1220

Trending Articles