近期项目中,在PO中做接口 遇到OAUTH2.0认证方式,token获取过程中编码格式为 ”application/x-www-form-urlencoded“
实现过程错误记录:
经过工具测试发现他的提交内容是通过key1=value1&key2=value2 在请求头中发送的,想在PO中通过Bady发送拼接字符串,设置http header Content-type= application/x-www-form-urlencoded实现
经测试的结果发现返回结果401,说明解析失败
在RESTAddapter 中报文格式设置Json后 http header Content-type 无论设置与否 都是按照text/plain解析,它不能是个Json对象,因此不会获取授权信息
解决方案:
application/x-www-form-urlencoded 是所谓的url编码格式,在询问对方参数是否可以实现url拼接后,通过ERP->PO传输动态的值,最后通过mapping传输拼接在地址中发送
- x-www-form-urlencoded application urlencoded 接口 编码x-www-form-urlencoded application urlencoded x-www-form-urlencoded restemplate application x-www-form-urlencoded application springboot application x-www-form-urlencoded form前端 x-www-form-urlencoded表单application urlencoded x-www-form-urlencoded urlencoded接口form x-www-form-urlencoded x-www-form-urlencoded urlencoded类型fegin 空格urlencoder编码encode urlencode编码delphi url