Http Header “Content-Type“的 application/x-www-form-urlencoded 与 application/json 的区别
通过POST方式提交数据到接口的时候,常常会遇到这种句子:webClient.Headers.Add(“Content-Type”, “application/json”);
或者webClient.Headers.Add(“Content-Type”, “application/x-www-form-urlencoded”);
那究竟应该用哪种方式??????
答案 是跟我们提交的参数格式有关。
1、如果是通过页面表单方式提交,那就是"application/x-www-form-urlencod.
原创
2021-12-08 11:43:14 ·
2067 阅读 ·
2 评论