The documentation here says that setRequestProperty
sets the general request property.
So suppose I have the following code snippet showing the usage of setRequestProperty
as follows:
URL url = new URL(requestUrl);
URLConnection urlConn = url.openConnection();
urlConn.setRequestProperty("accept", "application/json");
urlConn.setRequestProperty("datetime", dateTimeString);
urlConn.setRequestProperty("authorization", authorization);
urlConn.setUseCaches(false);
urlConn.setDoInput(true); // Triggers POST
Q1: Does accept
need to have an uppercase A
here? Similarly, for authorization
, does it need to have an uppercase A
as well? The reason I am asking this is because I have seen many post where people have been using authorization
as say for example conn.setRequestProperty ("Authorization", "Basic " + encodedString);
. This is shown here.
Q2. Since I have lot of setRequestProperty
property defined above, does this means that, a URL contains all of these properties? Are there any other properties that exists besides the one I have used above?