Here is function.json snippet
{
"bindings": [
{
"authLevel": "function",
"name": "query",
"type": "httpTrigger",
"direction": "in",
"methods": [
"get",
"post"
]
Here is my run.csx file:
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)
{
Now I need to call this Http triggered function from another function. I am doing:
var url = "https://azurefunction...";
var content2 = new StringContent(string.Format("{{\"AdvanceDays\":7}}"));
var response = await client.PostAsync(url,content2);
But I get the following error:
No MediaTypeFormatter is available to read an object of type 'Query' from content with media type 'text/plain'.
How do I fix this? Please help!!!