HttpGet request = new HttpGet("https://192.168.1.140:8732/...);
I wonder why I can only send successfully for custom headers : UserName and AuthToken if I do the following:
request.setHeader("User-Agent", "android_client");
request.setHeader("Host", "192.168.1.140:8732");
request.addHeader("UserName", mUserName);
request.addHeader("AuthToken", mAuthorizationToken);
Why is that this code NOT sending the UserName but AuthToken only? When the two bottom lines are reversed.
request.setHeader("User-Agent", "android_client");
request.setHeader("Host", "192.168.1.140:8732");
request.addHeader("AuthToken", mAuthorizationToken);
request.addHeader("UserName", mUserName);
Why is this code failing with 400 error code, invalid hostname when I don't specific the host
// request.setHeader("User-Agent", "android_client");
// request.setHeader("Host", "192.168.1.140:8732");
request.addHeader("UserName", mUserName);
request.addHeader("AuthToken", mAuthorizationToken);
If I don't need to send the UserName and AuthToken, I don't really need to set the Host and it works just fine with the code commented out like following
// request.setHeader("User-Agent", "android_client");
// request.setHeader("Host", "192.168.1.140:8732");
Though I don't think that it is related, I want to disclose that I am using self-signed certificate for these http call from android following this blog. Looking forward to the divine revelation for my poor http soul ...