I'm calling a microservice API using RestSharp with a POST message in a RestClient ExecuteAsync call for testing purposes. The data is coming back null and an error message is being returned as Data at the root level is invalid. Line 1, position 1.
The call works otherwise in the normal course of using the API in our application. The API returns a FileContentResult. I see information in the Content.
public static async Task<IRestResponse<FileContentResult>> ExecuteAsyncFileRequests(this RestClient client, IRestRequest request)
{
var response = await client.ExecuteAsync<FileContentResult>(request);
return response;
}