Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- // Initialize a new instance of the MemoryStream class.
- using (MemoryStream MemoryStream = new MemoryStream()) {
- // Copy the contents of the incoming HTTP entity body to the memory stream.
- Request.InputStream.CopyTo(MemoryStream);
- // Create a binding for a type with the provided values.
- YOUR_TYPE_HERE Bound = (YOUR_TYPE_HERE)JsonConvert.DeserializeObject(Request.ContentEncoding.GetString(MemoryStream.ToArray()), typeof(YOUR_TYPE_HERE));
- // HANDLE BINDING
- }
- } catch {
- // HANDLE FAILURE
- }
Add Comment
Please, Sign In to add comment