Hi @Gokulnath Palani [Teams] ,
That's not in the same rest api all. You need to make two rest api call to achieve this.
First, set the ReadOnlyField to false for created by field.
URI: _api/web/lists/getbytitle('test')/fields/getbytitle('Created By')
Body:
{
"__metadata": { "type": "SP.FieldUser"},
"ReadOnlyField": false
}
Then make another rest api call to create item in Sharepoint
URI: _api/web/lists/getbytitle('test')/items
BODY:
{
"__metadata": { "type": "SP.Data.TestListItem" },
"Title" : "Submited",
"AuthorId" : 9
}