I have finally got Services up and running and setup an endpoint to nodes but can't work out how to update custom fields from a POST or PUT.
Been trawling through the docs, examples, and tutorials but none seem to offer a simple explanation of the XML payload schema to update custom fields of nodes (Using REST).
Below is an example of what I'm putting into by test client (Using REST console for Chrome plugin)
URL: http://example.com/task/node/65 Encoding: application/x-www-form-urlencoded METHOD: PUT
<title>New Title</title> <body>New Body Content</body>
However this doesn't update anything, I just get the following response:-
<?xml version="1.0" encoding="utf-8"?> <result> <nid>65</nid> <uri>http://example.com/task/node/65</uri> </result>
It seems to create a revision and logs the update, but no fields are updated.
Can anyone advise the schema I need to follow for the payload? Thanks for any help or pointers!
EDIT: Thanks to Clive for a key pointer: Sticking ".xml" on the end of the URL seemed to make it update the body field, and then changing the content-type header to application/xml seemed to help as well.
So the following REST client config is now working:-
REQUEST METHOD: PUT
<?xml version="1.0" encoding="UTF-8"?> <data> <name>user</name> <title>Change this owner!</title> <body> <und is_array="true"> <item> <value>Another owner test</value> </item> </und> </body> </data>
Screenshot to help anyone else using the Chrome REST Console plugin:-
NOTE: I removed all security for the service and content type to make testing it easier but wouldn't recommend this on a public server!