c# - How to parse this JSON using JSON.Net? -


i cannot retrieve values inside queued_messages. im using c# here sample json data:

{   "queued_messages":    [     "messageid082420150825111152",     "messageid082420150825111153",     "messageid082420150825111154"   ] } 

here code:

string json = httprequest.message.trim();  jobject jsonids = jobject.parse(json);  queued_messages queuedmessageids = jsonids["queued_messages"].toobject<queued_messages>(); 

class of queued_messages:

  public class queued_messages   {       [jsonproperty("queued_messages")]       public string queued_messages { get; set; }   } 

queued_messages must array

public class queued_messages {     [jsonproperty("queued_messages")]     public string[] queued_messages { get; set; } }  jobject jsonids = jobject.parse(json); queued_messages queuedmessageids = jsonids.toobject<queued_messages>(); 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -