0
votes

Does anyone know if it is possible to get the current HTTP verb from the request inside a JsonMediaTypeFormatter or MediaTypeFormatter? I built a formatter that sanitizes input strings in JSON PUT & POST requests, however I don't seem to have access to the http context inside the ReadFromStreamAsync event. I'd hate to have to parse all objects on a GET request as that will kill performance.

I am using the Json.Net implementation in .net 4.5.

1

1 Answers

0
votes

Facepalm. HttpContext.Current.Request.HttpMethod solves my problem.