I am trying to make a Get request to an Azure Function (v1) that uses NReco HtmlToImageConverter, but for some reason I get the 500 status code with the following message
No MediaTypeFormatter is available to read an object of type 'Object' from content with media type 'application/octet-stream'.
EDIT: I don't think the problem is what's described here
I Publish literally empty function V1 to Azure and it doesn't work.
[FunctionName("Function1")]
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
// parse query parameter
string name = req.GetQueryNameValuePairs()
.FirstOrDefault(q => string.Compare(q.Key, "name", true) == 0)
.Value;
// Get request body
dynamic data = await req.Content.ReadAsAsync<object>();
// Set name to query string or body data
name = name ?? data?.name;
return name == null
? req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body")
: req.CreateResponse(HttpStatusCode.OK, "Hello " + name);
}
I don't know if its related but when I publish I get the following dialog (to which I currently answer with No)