I am doing this request :
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "username=George&password=toto");
Request request = new Request.Builder()
.url("http://localhost:8080/login")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
try {
Response response = client.newCall(request).execute();
} catch (IOException e) {
e.printStackTrace();
}
But how to get the cookies that the server returned me? I just want to store it on a String variable (that's all)
Thank you in advance !