post man以Content-type: application/octet-stream方式请求api
在请求头headers中将Content-type改为application/octet-stream方式(流方式),发送数据
后端api
//控制器要继承ControllerBase[HttpPost][DontWrapResult]public async Task<dynamic> GetReturnStateAsync() {try{using (var ms = new MemoryStream(2048)){await Request.Body.CopyToAsync(ms);var bs = ms.ToArray();//得到二进制数据string s = Encoding.UTF8.GetString(bs);//MemoryStream转stringvar data = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(s);//反序列化string aa = data.msgdata.result.ToString();//取值 if (!string.IsNullOrEmpty(aa)){return new { statusCode = "00", desc = "成功" };}else{return new { statusCode = "03", desc = "失败" };} }}catch (Exception e){return Json(new { statusCode = "03", desc = e.Message });}}
post man以Content-type: application/octet-stream方式请求api相关推荐
- Spring Boot——[Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported]解决方案
问题描述 2020-02-13 19:32:04.322 WARN 109508 --- [p-nio-80-exec-4] .m.m.a.ExceptionHandlerExceptionResol ...
- “Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported“解决方法
项目接口返回 code: 500 data: null message: "Content type 'application/x-www-form-urlencoded;charset=U ...
- jmeter报“msg“:“Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported“的解决方法
jmeter报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supp ...
- Error while extracting response for type [class xxx] and content type application/xml;charset=UTF-8
强烈推荐一个大神的人工智能的教程:http://www.captainbed.net/zhanghan [前言] 最近在用restTemplate进行一次http请求时发现了报错(Error whil ...
- Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
问题描述: 我写了一个接口,这个接口参数是这样的 @ResponseBody @RequestMapping(value = "importData", method = Requ ...
- 请求状态为200,前端报系统出错,后端日志报“Content type ‘application/octet-stream‘not supported“错误
请求后端出现"Content type 'application/octet-stream'not supported"错误 错误描述: Content type 'applica ...
- Springboot 报错Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
SpringBoot错误解决 1.错误展示 2021-03-23 12:20:02.805 ERROR org.springframework.web.HttpMediaTypeNotSupporte ...
- 苹果微信推送服务器错误,接入WxPusher微信推送服务出现错误:Content type application/x...
背景 使用WxPusher微信推送服务 ,可以及时的将服务的一些运行异常信息,发送到自己的微信上,方便了解服务的运行状态(PS:这个服务是免费的). 你可以在这里看到WxPusher微信推送服务的接入 ...
- HttpMediaTypeNotSupportedException: Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ n
问题如下: Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'applicatio ...
- Handler execution resulted in exception: Content type 'application/json;charset=UTF-8' not supported
postman测试接口的时候报415错误,上网看了之后发现都是说jar包的问题,我导入了jar包发现还是不好使,试了好几次,有哪位大牛帮我一下,控制台输出的是不支持application/json;c ...
最新文章
- LeetCode Single Number III(位操作)
- 内联函数和编译器对Go代码的优化
- 内网访问不到内网网站问题和不用端口号访问网站问题
- glassfish默认密码_在MySQL上使用含盐密码的GlassFish JDBC安全性
- 宁波大学2020计算机技术复试线,宁波大学关于公布2020年硕士研究生复试分数线的通知...
- 全栈性能测试修炼宝典jmeter实战电子版_推荐一款技术人必备的接口测试神器:Apifox...
- java基于springboot高校后勤报修管理系统
- 华为面试题之洞穴逃生
- DVWA——暴力破解
- 为什么使用Flatten layer?
- nodejs高考志愿填报辅助系统的设计与实现vue
- 【MRI】解决DPABI计算功能连接时路径冲突
- java scala_1400万美元的资本资金,Scala准备接受Java
- Power BI(十五)power pivot之Summarize函数
- 本地提交到github时出现错误
- 猫狗大战——pytorch+resnet18
- 24 碰到的一个 idea的奇怪的编码问题
- [C++] map集合的使用
- ctfshow 千字文 writeup
- Python 零代码的22个小游戏集合 freegames
热门文章
- 【开源电机驱动】如何计算电机参数
- 组织的目的是使平凡的人做出不平凡的事 --- 彼得.德鲁克 《卓有成效的管理者》
- 线性代数的那些事(二)行列式与逆
- 票务网 php,电影票务网站的设计与制作
- Hadoop集群能打开50070端口网页不能打开8088端口网页
- mipi两线接口_什么是MIPI接口
- 行走在古道间,看时光深处,
- 谜底是计算机病毒的谜语,有关于安全的谜语及谜底答案解析|谜底是粽子的谜语...
- 阿里技术专家甘盘:浅谈双十一背后的支付宝LDC架构和其CAP分析(含phil补充)
- 再仔细读读react18官方文档吧 20220531