how to add or set RequestProperty before opening java.net.URLConnection
it is throwing IllegalStateException if am trying to call setRequestProperty() after opening the connection