Hello.
I solved this by adding the following in post.php in the save function:
// add custom fields
if ( !empty($values["custom"]) ) {
foreach ($values["custom"] as $metakey => $metavalue) {
update_post_meta($this->id,$metakey,$metavalue);
}
}
The query:
https://localhost/site/?json=posts/create_post&dev=1&nonce=xxx&title=Post%20title&status=publish&custom[custom_field_1]=value1&custom[custom_field_2]=value2
Query for listing the fields in the response:
https://localhost/site/?json=posts/create_post&dev=1&nonce=xxx&title=Post%20title&status=publish&custom[custom_field_1]=value1&custom[custom_field_2]=value2&custom_fields=custom_field_1,custom_field_2