1

I'm using RESTFul Web Services module with Drupal 7. I can log in with basic authentication, get CSRF-token, get nodes, and so on.

The problem is with POST/PUT: I cannot get adding nodes to work. I get a node of type "page" and I use the same structure to do the post. But it doesn't work.

I'm using Delphi RAD Studio 2010 and Indy components to connect with RESTFul service. It works good with all restful request. When I do a POST, I get a 200 OK result, but the page is NOT added.

Here is the XML structure I use:

<node>
<body>
  <value>This is a simple test page</value>
  <summary/>
  <format>full_html</format>
</body>
<type>page</type>
<title>Test Page</title>
<language>es</language>
<status>1</status>
<promote>0</promote>
<sticky>0</sticky>
<views>0</views>
<day_views>0</day_views></node>

I send csrf-token with post, and server gives me 200 OK.

My question: Where could be the problem, perhaps the XML structure is incorrect?

0

After a lot of research about my question I've changed to format, which works fine.

I still think I have an error in my XML structure, but since it works with JSON now, I switched to using that instead.

UPDATE: With this data it works fine.

{ "title":"Test page", 
  "type":"page", 
  "status":0, 
  "language":"es", 
  "author":1,
  "body":{  "value": "Aptent bene capto euismod ...",
            "summary":"", 
            "format":"filtered_html"
         }
}
|improve this answer|||||
  • I'd be interested to understand what the equivalent JSON would look like, can you edit this answer please by including that in it? Of course, I'd also be interested in an answer to the original question ... if anybody has a clue what the reason might be for the XML failure. Better still: what can one do to actually DEBUG the issue described in the original question? – Pierre.Vriens Mar 14 '15 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.