Help reading JSON from HttpContext.InputStream

前端 未结 2 1595
挽巷
挽巷 2020-12-04 02:07

I have created a HttpModule to capture requests for auditing purposes.

For Ajax requests to a web method I would like to also log the JSON data associated with the r

2条回答
  •  感动是毒
    2020-12-04 03:04

    The stream can't be read as far as i know. You might write you own handler, then buffer the stream, by reading and writing to another stream.

    To parse the JSON part you might try

    System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(string input);
    

提交回复
热议问题