-
大小: 869KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-05-24
- 语言: Java
- 标签: httpclient
资源简介
httpclient模拟登陆代码以及相关的jar包
代码片段和文件信息
package com.broada.httpclient.recordsystem;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
/**
* 通过模拟登录获取录播系统的HTML页面
*
* @author Administrator
* Create By 2014年5月26日 上午9:52:29
*/
public class RecordingSystemAnalogLogon {
public static String getHtmlByHttpClient(String usernameString password) {
String html =““;
try {
// COSS服务地址
String cossServer = “http://10.253.135.212/login“;
HttpClient client = new HttpClient();
// 设置模拟登录页面的参数
NameValuePair[] nameValuePairs =
{ new NameValuePair(“username“ username)
new NameValuePair(“password“ password) };
// Post提交登录验证的页面
PostMethod method = new PostMethod(cossServer);
method.setRequestBody(nameValuePairs);
client.executeMethod(method);
String url = “http://10.253.135.212/room“;
GetMethod get = new GetMethod(url);
client.executeMethod(get);
html = get.getResponseBodyAsString();
} catch (Exception e) {
e.printStackTrace();
}
return html;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-06-05 16:32 httpclient模拟登陆\
目录 0 2014-06-05 16:32 httpclient模拟登陆\com\
目录 0 2014-06-05 16:32 httpclient模拟登陆\com\broada\
目录 0 2014-06-05 16:32 httpclient模拟登陆\com\broada\httpclient\
目录 0 2014-06-05 16:32 httpclient模拟登陆\com\broada\httpclient\recordsystem\
文件 1236 2014-06-05 11:36 httpclient模拟登陆\com\broada\httpclient\recordsystem\RecordingSystemAnalogLogon.java
目录 0 2014-06-05 16:32 httpclient模拟登陆\lib\
文件 288098 2014-06-05 11:31 httpclient模拟登陆\lib\HtmlParser.jar
文件 232771 2014-06-05 11:31 httpclient模拟登陆\lib\commons-codec-1.6.jar
文件 305001 2014-06-05 11:31 httpclient模拟登陆\lib\commons-httpclient-3.1.jar
文件 109043 2014-06-05 11:31 httpclient模拟登陆\lib\commons-io-1.4.jar
文件 62050 2014-06-05 11:31 httpclient模拟登陆\lib\commons-logging-1.1.3.jar
相关资源
- httpcore-4.0.jar
- HttpClient for android 4 3 5 jar
- HttpClient jar包
- httpclient-4.3.4.jar
- httpclient-4.3.6.jar
- http接口需要的jar包
- httpclient get/post请求工具类map参数封装
- HttpClient4.5 实现https忽略SSL证书验证
- 基于HttpClient 4.3的可访问自签名HTTPS站
- httpclient-4.5.5 完整架包
- HttpClient发送http请求需要的jar包
- httpClient jar包.rar
- httpclient-4.5所需jar包
- commons-httpclient-3.0.jar
- httpclient-4.5 jar
- org.apache.commons.httpclient. jar
- android httpclient asynctask demo
- httpcore-4.2.4.jar 和 httpclient-4.2.5.jar
- java 访问 wcf 使用的HttpClient
- httpcore-4.3.2和httpclient-4.3.3.jar
- HttpClient官方最新jar包。
- org.apache.commons.httpclient. jar 程序文件
- httpclient-4.5.1.jar
- HttpClientUtil工具类,调用第三方接口
- httpclient过时用的jar包
- HttpClient 4.3.1必要jar包
- Android通过POST和GET向服务器发送数据
- httpclient-4.2.5.jar
- Httpclient所需jar包
- 使用HttpClient图片
评论
共有 条评论