use of okhttp3.Cookie in project Gradle-demo by Arisono.
the class testUASApi method checkLoginAtB2B.
public static void checkLoginAtB2B(String cookie) {
String url = "http://uas.ubtob.com/authentication";
OkhttpUtils.println(cookie);
// cookie="JSESSIONID=AAD026810600CE98B72C1B035133B7AD; Path=/; HttpOnly,uid=4sjrtiHZOu3sG71-9lOyB1jEPXOxBgJ_3jjuugBiDcZs9xlBhPHqdaypUNveDTUwUV8V2UZiz_XyiF54d5oA8etWywLg7AiREkmq93ydcqvCVc4-lBf0bGEQMIIvck2mx-4UFRkgZW0SinAqerzvnjG20OD4co1xYOH3GvPFYozb_8vt7AARwVeoDvRWutb8Fn-30hx4ABq-71kD7qCxpVZVFV08Z18APcJLGWy3djt4tegS8kFjXdwfjNHgjUBhlxlbbJz2561foZeffYi4K51ayiZVLZjfo4hPHlbNMrCP-InSzgVh_kEzq4PmSr_2QWXbwH_PzLiT_QUf1oKLjECvqXpW0bJquxlEWRLRAXpmmGpu96yGszEdJ2d-XtHeCjXHOgBSe_UWEVFpM9us57u5rBiOWGF_qKb2X2sV3ZuQWAu2mCRRp8jFRP0lYGwjywCg2Lk-CPjHxGsSyKorqpHk6JNRAOLp2DVEKgRFDxHP9VpKfDYlHf756eDHW0Jpiym962jTu3ARMNbUaUMrOkmoS9DhuvhxdbyuK7KecyEG2flEdL6cA75Seb6z_egZw26Df3cFTPbtKseXGk4X3XU3vEmAAwl9ABOuz0Iuq6vkS46gfg..;domain=.ubtob.com;path=/;HTTPOnly;";
// OkhttpUtils.println(cookie);
Request request = new Request.Builder().url(url).addHeader("content-type", "text/html;charset:utf-8").addHeader("Cookie", cookie).build();
OkhttpUtils.client.newCall(request).enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) throws IOException {
String json = OkhttpUtils.getResponseString(response);
OkhttpUtils.println("B2B登录检查::" + json);
}
@Override
public void onFailure(Call call, IOException e) {
OkhttpUtils.onFailurePrintln(e);
}
});
}
use of okhttp3.Cookie in project Gradle-demo by Arisono.
the class testUASApi method selectDetailData.
/**
* 表单详细数据接口
* mobile/common/getformandgriddata.action?caller=Workovertime&id=12865
*/
public static void selectDetailData() {
String url = baseurl + "mobile/common/getformandgriddata.action";
RequestBody formBody = new FormBody.Builder().add("master", master).add("id", "12865").add("caller", "Workovertime").add("sessionId", sessionId).build();
Request request = new Request.Builder().url(url).header("cookie", "JSESSIONID=" + sessionId).addHeader("sessionUser", emcode).addHeader("content-type", "text/html;charset:utf-8").post(formBody).build();
OkhttpUtils.client.newCall(request).enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) throws IOException {
OkhttpUtils.println(OkhttpUtils.getResponseString(response));
;
}
@Override
public void onFailure(Call call, IOException e) {
OkhttpUtils.onFailurePrintln(e);
}
});
}
use of okhttp3.Cookie in project Gradle-demo by Arisono.
the class testUASApi method api_getWorkDate.
/**
* 获取班次
*/
public static void api_getWorkDate() {
String url = baseurl + "mobile/getWorkDate.action";
RequestBody formBody = new FormBody.Builder().add("date", "20170214").add("master", master).add("emcode", emcode).build();
OkhttpUtils.println(url);
Request request = new Request.Builder().url(url).header("cookie", "JSESSIONID=" + sessionId).addHeader("sessionUser", emcode).addHeader("content-type", "text/html;charset:utf-8").post(formBody).build();
OkhttpUtils.client.newCall(request).enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) throws IOException {
String json = OkhttpUtils.getResponseString(response);
OkhttpUtils.println("班次接口:" + json);
}
@Override
public void onFailure(Call call, IOException e) {
OkhttpUtils.onFailurePrintln(e);
}
});
}
use of okhttp3.Cookie in project Gradle-demo by Arisono.
the class testUASApi method upateFormData.
/**
* 动态表单 更新接口
*/
public static void upateFormData() {
String url = baseurl + "mobile/commonUpdate.action";
RequestBody formBody = new FormBody.Builder().add("master", master).add("gridStore", "null").add("formStore", "{\"va_holidaytype\":\"按小时\",\"va_vacationtype\":\"事假\",\"va_status\":\"在录入\",\"va_emcode\":\"sunquan\",\"va_emname\":\"龚鹏明\",\"va_department\":\"测试111\",\"va_position\":\"测试\",\"va_mankind\":\"副总及以上\",\"va_alldays\":\"12\",\"va_alltimes\":\"25\",\"va_startime\":\"2016-11-28 13:39:00\",\"va_remark\":\"测试\",\"va_recordor\":\"刘佳\",\"va_date\":\"2016-11-28 13:39:00\",\"va_endtime\":\"2016-12-28 13:39:00\"}").add("caller", "Ask4Leave").add("sessionId", sessionId).build();
Request request = new Request.Builder().url(url).header("cookie", "JSESSIONID=" + sessionId).addHeader("sessionUser", emcode).addHeader("content-type", "text/html;charset:utf-8").post(formBody).build();
OkhttpUtils.client.newCall(request).enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) throws IOException {
OkhttpUtils.println(OkhttpUtils.getResponseString(response));
}
@Override
public void onFailure(Call call, IOException e) {
OkhttpUtils.onFailurePrintln(e);
}
});
}
use of okhttp3.Cookie in project Gradle-demo by Arisono.
the class testUASApi method addMobileMac.
public static void addMobileMac(String method) {
//master=USOFTSYS, emcode=U0316, sessionUser=U0316, sessionId=29DB60DE6E40D859B9169FE5013A8520, macAddress=3c:b6:b7:64:a7:ea
String url = baseurl + "mobile/addMobileMac.action";
RequestBody formBody = new FormBody.Builder().add("master", master).add("emcode", emcode).add("macAddress", "3c:b6:b7:64:a7:ea").add("sessionId", sessionId).build();
Request request = new Request.Builder().url(url).header("cookie", "JSESSIONID=" + sessionId).addHeader("sessionUser", emcode).addHeader("content-type", "text/html;charset:utf-8").post(formBody).build();
OkhttpUtils.client.newCall(request).enqueue(new Callback() {
@Override
public void onResponse(Call call, Response response) throws IOException {
OkhttpUtils.println(OkhttpUtils.getResponseString(response), OkhttpUtils.typeMiddle, method);
getStringCode("getStringCode");
return;
}
@Override
public void onFailure(Call call, IOException e) {
OkhttpUtils.onFailurePrintln(e);
}
});
}
Aggregations