I've got a content type with "File" field and "File" widget. I am successfully able to create a node without a file using restws. But, if I want to attach a file to it, it just doesn't allow me to do that. I've tried many different things, but with failure.
Also, when accessing a node with file already attached to it, using get request (e.g. {domain_name}/node/219.json), the file field is displayed as an empty element, even though file is existing and is displayed fine when viewing the node in edit mode from admin area.
E.g.
JSON:
"field_simple_file":[]
XML:
<field_simple_file/>
The node array without file field, that succeeds is as below:
$new_node = array(
'body' => array(),
'type' => 'simple',
'title' => 'Content created with restws',
'language' => 'und',
'status' => 1,
'promote' => 0,
'sticky' => 0,
'author' => 1
);
And content-type:
'Content-Type: application/json'
But I think, I am not 100% sure on how to include a file in it (have tried few different things), which might be leading to failure. Can anyone provide me with guidance for attaching/uploading a file with restws please?