21
I have a web request that is sending the server data that is in the format application/x-www-form-urlencoded. I would like to convert it to application/json.
Example:
URL-encoded form data:
Property1=A&Property2=B&Property3%5B0%5D%5BSubProperty1%5D=a&Property3%5B0%5D%5BSubProperty2%5D=b&Property3%5B1%5D%5BSubProperty1%5D=c&Property3%5B1%5D%5BSubProperty2%5D=d
Pretty version:
Property1=A
Property2=B
Property3[0][SubProperty1]=a
Property3[0][SubProperty2]=b
Property3[1][SubProperty1]=c
Property3[1][SubProperty2]=d
The above data needs to be converted to the following JSON data:
{
Property1: "A",
Property2: "B",
Property3: [
{ SubProperty1: "a", SubProperty2: "b" },
{ SubProperty1: "c", SubProperty2: "d" }]
}
Question:
Are there any free tools that are capable of doing this? I have not been able to find any myself and if they exist, I'd rather consume them than writing one myself, but if it comes to that, I will.
A C#/.Net solution is preferred.