What do you want to save?
Add Code snippet
New code examples
-
C# 2022-03-16 11:15:47
.net httpclient add body
public async string Example() { //The data that needs to be sent. Any object works. var pocoObject = new { Name = "John Doe", Occupation = "gardener" }; //Converting the object to a json string. NOTE: Make sure the ob... Add solution -
Javascript 2022-03-02 20:40:53
c# json from file to object
// read file into a string and deserialize JSON to a type Movie movie1 = JsonConvert.DeserializeObject<Movie>(File.ReadAllText(@"c:\movie.json")); // deserialize JSON directly from a file using (StreamReader file = File.OpenText(@"c:... Add solution -
Javascript 2022-02-25 10:00:02
c# json foreach key value
var dict = JObject.Parse(@"{""1"":""Name 1"",""2"":""Name 2""}"); var dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(json); foreach(va... Add solution -
C# 2022-01-24 00:10:15
restsharp c#
//example code var lst = await service.ConnectHttpClient<User, List<User>>("api/User/GetUserInfoByUserId", new User() { UserId = 1 }); var lst = await service.ConnectRestClient<User, List<User>>("api/User/GetUserInfo... Add solution -
C# 2022-01-23 06:15:24
parse json C#
Product product = new Product(); product.Name = "Apple"; product.Expiry = new DateTime(2008, 12, 28); product.Price = 3.99M; product.Sizes = new string[] { "Small", "Medium", "Large" }; string json = JsonConvert.Se... Add solution