Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Supplementing with my previous answer. Newtonsoft can be used with dynamic when deserialize an object. Is performed in this way.</p> </blockquote> <pre><code>var results = JsonConvert.DeserializeObject&lt;dynamic&gt;(json); var experience= results.Experience; var status= results.Status; var name= results.Name; var uuid= results.Uuid; var dynamic_property= results.AnotherProperty; </code></pre> <blockquote> <p>Another way. If you know all possible properties of the class to parse. You can use a JsonProperty attribute of Newtonsoft.Json and use a DeserializeObject strong typed.</p> </blockquote> <pre><code>public class MyModel { [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public int experience {get;set;} [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public bool status {get;set;} [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string name {get;set;} [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string uuid {get;set;} [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public object property_1 {get;set;} [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public object property_2 {get;set;} ... } </code></pre> <blockquote> <p>You can make a request:</p> </blockquote> <pre><code>var httpRequest = WebRequest.Create(string.Format("baseurl" + "/PostData?id={0}", id)); httpRequest.Method = "POST"; httpRequest.ContentType = "application/json"; httpRequest.ContentLength = data.Length; try { using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream())) { if (!string.IsNullOrEmpty(data)) { streamWriter.Write(data); streamWriter.Flush(); streamWriter.Close(); } } var response = httpRequest.GetResponse(); } catch (Exception) {} </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload