で失敗した私は、Androidを開発し、私は以下のOKHTTP3Androidのポスト要求がOKHTTP
でhttps://m.colorado.edu/mycuinfo/にログインしようとしていますに新しいですPOST URLがhttps://m.colorado.edu/mycuinfo/j_security_check
しかし、である私のコード
OkHttpClient client = new OkHttpClient();
HttpUrl url = HttpUrl.parse(urlString).newBuilder()
.addQueryParameter("j_username", username)
.addQueryParameter("j_password", password)
.build();
Request request = new Request.Builder()
.url(url)
.build();
try {
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
} catch (IOException e){
e.printStackTrace();
}
です応答はログインページのソースコードです。
<form data-ajax="false" id="LoginForm" name="lForm" method="POST" action="j_security_check" autocomplete="off">
<p></p>
<b>CU Login Name:</b><br> <input tabindex="1" type="text" name="j_username" size="20" data-theme="c" />
<p></p>
<b>IdentiKey Password:</b><br> <input tabindex="2" type="password" name="j_password" size="20" data-theme="c" />
<p></p>
<button data-ajax="false" data-theme="a" value="Log in" tabindex="3">Login</button>
<p></p>
「 任意の考え?
私は個人的にはセッションとクッキーであるべきであるが、私はOKHTTP
ブラウザでhttps://m.colorado.edu/mycuinfo/j_security_check?j_username=**&j_password=***を試しました。しかし、私はOKHTTPを使用すると、同じ結果。 – jamiez