I am attempting a post request, and I have the following body:
{
"request": {
"__metadata": {
"type": "Microsoft.Office.Server.Search.REST.SearchRequest"
},
"Querytext": "query",
"TrimDuplicates": false,
"RowLimit": 100,
"SelectProperties": {
"results": [
"Title"
]
},
"SortList": {
"results": [
{
"Property": "Title",
"Direction": "0"
}
]
},
"SourceId": "d2045d82-3148-4a4d-9dfc-fecb81da2720"
}
}
I get the following response:
{"error":{"code":"-1, Microsoft.Data.OData.ODataException","message":{"lang":"en-US","value":"The property '__metadata' does not exist on type 'Microsoft.Office.Server.Search.REST.SearchRequest'. Make sure to only use property names that are defined by the type."}}}
I have found this answer, however I already have my body formatted in the way the answer suggests.