Вот код функции. Json
{
"bindings": [
{
"authLevel": "function",
"name": "query",
"type": "httpTrigger",
"direction": "in",
"methods": [
"get",
"post"
]
Вот мой файл run.csx:
public class Query{
public double AdvanceDays{get;set;}
}
public static async Task<HttpResponseMessage> Run(Query query,entity Entity,HttpRequestMessage req, TraceWriter log, IEnumerable<dynamic> inputDocument)
{
Теперь мне нужно вызвать эту функцию, активированную по протоколу Http, из другой функции. Я делаю:
var url = "https://azurefunction...";
var content2 = new StringContent(string.Format("{{\"AdvanceDays\":7}}"));
var response = await client.PostAsync(url,content2);
Но я получаю следующую ошибку:
No MediaTypeFormatter is available to read an object of type 'Query' from content with media type 'text/plain'.
Как мне это исправить? Пожалуйста, помогите !!!