2014-10-09 66 views
0

我有RestRequest,我格式化爲Json和添加併發送到Serialize,它工作得很好。我只想從restRequest對象中檢索生成的json。我怎麼能做到這一點?我在課堂內進行了搜索,發現無法看到身體。如何從RestRequest對象查看json?

感謝

[DataContract] 
public class ToSerialize 
{ 
    [DataMember] 
    public string somefield { get; set; } 
} 



     var request = new RestRequest("/someresource", Method.POST); 
     request.RequestFormat = DataFormat.Json; 
     var toSerialize = new ToSerialize(); 
     toSerialize.someField = "hey"; 
     request.AddBody(toSerialize); 
     var response = client.Execute(request); 

回答