HttpURLConnection使用get请求要怎么提交请求头(Authorization)呢

URL u = null;
HttpURLConnection con = null;
try {
u = new URL(“http://192.168.1.102/api/User/Page?pageIndex=1&pageSize=10");
con = (HttpURLConnection) u.openConnection();
con.setRequestMethod("GET");
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
// con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.addRequestProperty("Authorization", "Bearer NIOWysca2x78ARBsaPluv9eIcGvshRKX04pTirGAhBp4_pjTGhehhTkUO1ZTp8mVPjL9bFSREunNkjC2Gt7Pd4KofhxF9npxI3hcv4e2rzGyidt93XAQK0sIZGfJA413jkenXGqR1Mv69YQrm4M4RC0enrCUr6FKKxZ95qQ3vvlIpiBq49g9kqQAt_5iR3m5Tl_Vmp1AKrD5fVIqDlLdpg");
OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream(), "UTF-8");
osw.write("");
osw.close();
} catch (Exception e) {
e.printStackTrace();
}
无法访问,是不是头文件配置有误?

http://blog.csdn.net/redarmy_chen/article/details/26600757

conn.setRequestProPerty(name,value),设置方式是没有问题的。