// Tries to save received/decrypted JSON to database. // Returns true, if successful. private static Boolean processPost(HttpRequestBase request) { try { // Decrypts the JSON received from the request. string encryptedJSON = readRequestBody(request); string jsonString = Decrypt.DecryptString(encryptedJSON); // Saves JSON to database. JSONEntriesController.Create(jsonString); return(true); } catch { return(false); } }
// Main view - shows list of all received JSON strings. public ActionResult Index() { return(View(JSONEntriesController.Get())); }