Alex Rivera | Logout

Is WebRequest The Right C# Tool For Interacting With Websites?

Asked 2008-09-18T09:46:29.597
35

I'm writing a small tool in C# which will need to send and receive data to/from a website using POST and json formatting. I've never done anything like this before in C# (or any language really) so I'm struggling to find some useful information to get me started.

I've found some information on the WebRequest class in C# (specifically from here) but before I start diving into it, I wondered if this was the right tool for the job.

I've found plenty of tools to convert data into the json format but not much else, so any information would be really helpful here in case I end up down a dead end.

Edit
Report

2 Answers

0

To convert from instance object to json formatted string and vice-versa, try out Json.NET: http://json.codeplex.com/

I am currently using it for a project and it's easy to learn and work with and offers some flexibility in terms of serializing and custom type converters. It also supports a LINQ syntax for querying json input.

answered 2010-12-06T04:49:08.253
-1

in 3.5 there is a built-in jsonserializer. The webrequest is the right class your looking for.

A few examples:

answered 2008-09-18T09:52:00.923

Your Answer