加密请求/效应初探在MVC4的WebAPI [英] Encrypt Request/Reponse in MVC4 WebApi

查看:148
本文介绍了加密请求/效应初探在MVC4的WebAPI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有接收加密请求和加密的响应一旦完成一个旧的API。我试图此开关mvc4的WebAPI,它已经顺利,直到我打这个加密。我需要的是,当谈到在这样的MVC将正确地作用于它解密请求的方式。此外,一旦这个过程完成加密发送之前的响应。我不希望放置加密部分中的每个动作。

I have a old api that receives an encrypted request and encrypts the response once complete. I am attempting to switch this to mvc4 webapi and it has gone smooth until I hit this encryption. What I need is a way to decrypt the request when it comes in so mvc will act on it properly. Also once the process is complete encrypt the response before sending it. I do not want to place the encryption parts in each action.

请注意:
身体还是正确格式化为一个单一的项目,所以我会推动这一切通过与我自己的选择一个动作,而是将preFER更适当休息风格的实现。

Note: The body is still properly formatted as a single item, so I would push it all through a single action with a selector of my own, but would prefer a more proper rest style implementation.

推荐答案

您应该能够使用的MessageHandler做到这一点。有一堆如何在 WebAPIContrib 创建MessageHandlers例子

You should be able to do this with a MessageHandler. There are a bunch of examples of how to create MessageHandlers in WebAPIContrib

这篇关于加密请求/效应初探在MVC4的WebAPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆