( This failed when encountering a circularĪttempting to store each of the Properties within a Dictionary object and then using JSON to serialize the entire Dictionary ( in hopes that it would "flatten" the object out and make it easier to serialize) Request and attempting to construct a JSON string Using Reflection to iterate through each of the properties within the I'll detail a few of the approaches that I have taken so far below to possibly find any areas that I may have gone wrong. I'm just curious if there is a better method of handling this ( or what the best method of handling it may be). These only occur when actually encountering properties that do contain a circular reference, as I have previously used the following code to grab just specific elements that I need : JSON.Encode(new ) However, I quickly found that this causes all sorts of circular references to be thrown ( primarily due to the actual structure and complexity of the Request object). I originally thought that I would be able to easily accomplish it using the JSON.Encode() method as seen below : JSON.Encode(HttpContext.Request) I'm currently working on a proof-of-concept and ran into an issue involving using JSON to serialize an HttpRequest.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |