I am simply making a GET request to a Rest API using HttpURLConnection.
GET
HttpURLConnection
I need to add some custom headers but I am getting null wh
null
The conn.getHeaderField("CustomHeader") returns the response header not the request one.
conn.getHeaderField("CustomHeader")
To return the request header use: conn.getRequestProperty("CustomHeader")
conn.getRequestProperty("CustomHeader")