postman中传递@RequestBody参数 Content type ‘applicationoctet-stream‘ not supported

    技术2023-12-25  75

    一、问题描述

    Java接口如图,接口的入参被注解@RequestBody修饰,通过postman调用该接口时报错Content type 'application/octet-stream' not supported。

    二、解决方法

    1、在headers中添加Content-Type,value为application/json

    2、设置Body中的内容

    然后即可正常请求

    Processed: 0.015, SQL: 9