I am trying to create a new node using the restws drupal module. My content type has just two fields: title and a file. However, when i send the request with following payload, i get an error. The file which i am referring in the payload is already existing on my drupal server.
URL : CMS_BASE_URL/node Method : POST
Payload:
<?xml version="1.0" encoding="utf-8"?>
<data>
<field_my_file>
<file resource="file" id="24">CMS_BASE_URL/file/24</file>
</field_my_file>
<type>filetest</type>
<title>My 1st file test</title>
<language>en</language>
<author resource="user" id="5">
</author>
</data>
Error - 406 Not Acceptable: Invalid data value given. Be sure it matches the required data type and format.
Is there any problem in the way i am sending the payload? If i remove the "file" part from the payload, it is able to create node.Please guide me if this is not correct.