Request.Headers和Request.Body

 

// 1.获取Header的值
var headers = Request.Headers;
string appId = headers["appid"];//应用ID
string timestamp = headers["timestamp"];//发起请求的时间 单位秒


// 2.获取body的值
var stream = Request.InputStream;
byte[] b = new byte[stream.Length];
stream.Read(b, 0, (int)stream.Length);
var jsonBodyData = Encoding.UTF8.GetString(b);

 

posted @ 2022-07-12 17:30  ProZkb  阅读(257)  评论(0编辑  收藏  举报