1.conn.setRequestProPerty(name,value),两个参数都是字符串。。。。

2.用httpURLConnection的setRequestProPerty(name,value)方法,就能向header里添加信息。

如:设置content-type

httpURLConnection.setRequestProperty("token", "10051:abc");
        httpURLConnection.setRequestProperty("Content-type", "application/json"); 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-12-27
  • 2021-12-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案