Keep it Simple

// practice, the distance between dream and achievement

Tag: JSON (page 1 of 2)

JSON to C# class conversion using Paste Special in Visual Studio

There is a really cool new feature in Visual Studio 2013 that lets you paste JSON or XML and create a class hierarchy from it. For example, if you have the following JSON:

Continue reading

SSL – Underlying connection was closed

If you’ve ever had to make a web request to an HTTPS endpoint from C# you will likely run into this gem of an exception.

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

Who the what now?

Continue reading

Download images from a URL in C#

You may use the following method to retrieve the image from a specific URL on the web. The below C# function takes an image url, download the image from the url as a stream.

Continue reading

Converting Object into JSON in C#

In this post we are going to see how we can convert a object into JSON string.

You don’t need to download an additional library to serialize/deserialize your objects to/from JSON. Since .NET 3.5, .NET can do it natively.

For this demo we are using console application so we have to add System.Web and System.Web.Extensions reference to access the JavaScript Searilizer class through which we are going to convert this object into JSON string.

Continue reading

Older posts

© 2017 Keep it Simple

Theme by Anders NorenUp ↑