Rabskatran
Rabskatran

Reputation: 2299

Post on a REST Web Service : How can I get access to the POSTed input values?

Is there an tool(Class/Method) in the .NET Framework to transform the urlencoded string body of a Form POSTed like :

Id=O+mon+dieu%21&StringValue=Trop+facile&envoyer=Save

to, for instance, a key-value Dictionary?

{"Id","O mon dieu !"} {"StringValue" , "Trop facile"} {"envoyer", "Save"}

I guest there is a tool like this included...

FYI, it's to be used in a REST Web service.

Upvotes: 0

Views: 114

Answers (1)

Dmitry S.
Dmitry S.

Reputation: 8503

The HttpUtility.ParseQueryString method can take a URL encoded name value pairs and create a NameValueCollection instance with the data. It is similar to a dictionary but allows multiple values for a key, which is perfectly legal in your scenario.

http://msdn.microsoft.com/en-us/library/ms150046.aspx

Upvotes: 1

Related Questions