1.conn.setRequestProPerty(name,value),兩個參數都是字符串。。。。
2.用httpURLConnection的setRequestProPerty(name,value)方法,就能向header里添加信息。
如:設置content-type
httpURLConnection.setRequestProperty("token", "10051:abc"); httpURLConnection.setRequestProperty("Content-type", "application/json");