I need to verify if the content coming into my Azure http function is not empty and is of type JSON.
So I am doing this within my Azure function:
if (req.Body.Length == 0)
{
var nullresponse = req.CreateResponse(HttpStatusCode.BadRequest);
return nullresponse;
I want to check if it's type JSON too - any idea on how to do that?
req is type HttpRequestData as per normal on isolated functions.






yes, you need the check whether the
Content-Typeisapplication/jsonor not like below. Pay attention toHttpStatusCode.UnsupportedMediaTypealso.