发送Id,Pwd从java到python服务简单?

时间:2014-11-20 10:22:12

标签: java python service login httpwebrequest

我能够连接并从python服务获取数据,如

URL url = new URL("http://***.***.*.*:****/list");
                HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                conn.setReadTimeout(30000 /* milliseconds */);
                conn.setConnectTimeout(50000 /* milliseconds */);
                conn.setRequestMethod("GET");
                conn.setRequestProperty("User-Agent", "GYUserAgentAndroid");
                conn.setRequestProperty("Content-Type", "application/json");
                conn.setDoInput(true);
                conn.setUseCaches (false);
                conn.connect();

但是我愿意简单地将我的id和pwd发送到python服务并执行登录功能我的python服务已准备就绪,只是为了传递id pwd进行登录。我该怎么做?

任何帮助都会很明显

由于

0 个答案:

没有答案