package com.alipay.util.httpClient;_x000D_
_x000D_
import org.apache.commons.httpclient.NameValuePair;_x000D_
_x000D_
/* *_x000D_
 *类名：HttpRequest_x000D_
 *功能：Http请求对象的封装_x000D_
 *详细：封装Http请求_x000D_
 *版本：3.3_x000D_
 *日期：2011-08-17_x000D_
 *说明：_x000D_
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。_x000D_
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。_x000D_
 */_x000D_
_x000D_
public class HttpRequest {_x000D_
_x000D_
    /** HTTP GET method */_x000D_
    public static final String METHOD_GET        = "GET";_x000D_
_x000D_
    /** HTTP POST method */_x000D_
    public static final String METHOD_POST       = "POST";_x000D_
_x000D_
    /**_x000D_
     * 待请求的url_x000D_
     */_x000D_
    private String             url               = null;_x000D_
_x000D_
    /**_x000D_
     * 默认的请求方式_x000D_
     */_x000D_
    private String             method            = METHOD_POST;_x000D_
_x000D_
    private int                timeout           = 0;_x000D_
_x000D_
    private int                connectionTimeout = 0;_x000D_
_x000D_
    /**_x000D_
     * Post方式请求时组装好的参数值对_x000D_
     */_x000D_
    private NameValuePair[]    parameters        = null;_x000D_
_x000D_
    /**_x000D_
     * Get方式请求时对应的参数_x000D_
     */_x000D_
    private String             queryString       = null;_x000D_
_x000D_
    /**_x000D_
     * 默认的请求编码方式_x000D_
     */_x000D_
    private String             charset           = "GBK";_x000D_
_x000D_
    /**_x000D_
     * 请求发起方的ip地址_x000D_
     */_x000D_
    private String             clientIp;_x000D_
_x000D_
    /**_x000D_
     * 请求返回的方式_x000D_
     */_x000D_
    private HttpResultType     resultType        = HttpResultType.BYTES;_x000D_
_x000D_
    public HttpRequest(HttpResultType resultType) {_x000D_
        super();_x000D_
        this.resultType = resultType;_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * @return Returns the clientIp._x000D_
     */_x000D_
    public String getClientIp() {_x000D_
        return clientIp;_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * @param clientIp The clientIp to set._x000D_
     */_x000D_
    public void setClientIp(String clientIp) {_x000D_
        this.clientIp = clientIp;_x000D_
    }_x000D_
_x000D_
    public NameValuePair[] getParameters() {_x000D_
        return parameters;_x000D_
    }_x000D_
_x000D_
    public void setParameters(NameValuePair[] parameters) {_x000D_
        this.parameters = parameters;_x000D_
    }_x000D_
_x000D_
    public String getQueryString() {_x000D_
        return queryString;_x000D_
    }_x000D_
_x000D_
    public void setQueryString(String queryString) {_x000D_
        this.queryString = queryString;_x000D_
    }_x000D_
_x000D_
    public String getUrl() {_x000D_
        return url;_x000D_
    }_x000D_
_x000D_
    public void setUrl(String url) {_x000D_
        this.url = url;_x000D_
    }_x000D_
_x000D_
    public String getMethod() {_x000D_
        return method;_x000D_
    }_x000D_
_x000D_
    public void setMethod(String method) {_x000D_
        this.method = method;_x000D_
    }_x000D_
_x000D_
    public int getConnectionTimeout() {_x000D_
        return connectionTimeout;_x000D_
    }_x000D_
_x000D_
    public void setConnectionTimeout(int connectionTimeout) {_x000D_
        this.connectionTimeout = connectionTimeout;_x000D_
    }_x000D_
_x000D_
    public int getTimeout() {_x000D_
        return timeout;_x000D_
    }_x000D_
_x000D_
    public void setTimeout(int timeout) {_x000D_
        this.timeout = timeout;_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * @return Returns the charset._x000D_
     */_x000D_
    public String getCharset() {_x000D_
        return charset;_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * @param charset The charset to set._x000D_
     */_x000D_
    public void setCharset(String charset) {_x000D_
        this.charset = charset;_x000D_
    }_x000D_
_x000D_
    public HttpResultType getResultType() {_x000D_
        return resultType;_x000D_
    }_x000D_
_x000D_
    public void setResultType(HttpResultType resultType) {_x000D_
        this.resultType = resultType;_x000D_
    }_x000D_
_x000D_
}_x000D_

/**_x000D_
     * 待请求的url_x000D_
     */
package com.alipay.util.httpClient;_x000D_
_x000D_
import org.apache.commons.httpclient.NameValuePair;_x000D_
_x000D_
/* *_x000D_
 *类名：HttpRequest_x000D_
 *功能：Http请求对象的封装_x000D_
 *详细：封装Http请求_x000D_
 *版本：3.3_x000D_
 *日期：2011-08-17_x000D_
 *说明：_x000D_
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。_x000D_
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。_x000D_
 */_x000D_
_x000D_
public class HttpRequest {_x000D_
_x000D_
    /** HTTP GET method */_x000D_
    public static final String METHOD_GET        = "GET";_x000D_
_x000D_
    /** HTTP POST method */_x000D_
    public static final String METHOD_POST       = "POST";_x000D_
_x000D_
    /**_x000D_
     * 待请求的url_x000D_
 <SUF>*/_x000D_
    private String             url               = null;_x000D_
_x000D_
    /**_x000D_
     * 默认的请求方式_x000D_
     */_x000D_
    private String             method            = METHOD_POST;_x000D_
_x000D_
    private int                timeout           = 0;_x000D_
_x000D_
    private int                connectionTimeout = 0;_x000D_
_x000D_
    /**_x000D_
     * Post方式请求时组装好的参数值对_x000D_
     */_x000D_
    private NameValuePair[]    parameters        = null;_x000D_
_x000D_
    /**_x000D_
     * Get方式请求时对应的参数_x000D_
     */_x000D_
    private String             queryString       = null;_x000D_
_x000D_
    /**_x000D_
     * 默认的请求编码方式_x000D_
     */_x000D_
    private String             charset           = "GBK";_x000D_
_x000D_
    /**_x000D_
     * 请求发起方的ip地址_x000D_
     */_x000D_
    private String             clientIp;_x000D_
_x000D_
    /**_x000D_
     * 请求返回的方式_x000D_
     */_x000D_
    private HttpResultType     resultType        = HttpResultType.BYTES;_x000D_
_x000D_
    public HttpRequest(HttpResultType resultType) {_x000D_
        super();_x000D_
        this.resultType = resultType;_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * @return Returns the clientIp._x000D_
     */_x000D_
    public String getClientIp() {_x000D_
        return clientIp;_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * @param clientIp The clientIp to set._x000D_
     */_x000D_
    public void setClientIp(String clientIp) {_x000D_
        this.clientIp = clientIp;_x000D_
    }_x000D_
_x000D_
    public NameValuePair[] getParameters() {_x000D_
        return parameters;_x000D_
    }_x000D_
_x000D_
    public void setParameters(NameValuePair[] parameters) {_x000D_
        this.parameters = parameters;_x000D_
    }_x000D_
_x000D_
    public String getQueryString() {_x000D_
        return queryString;_x000D_
    }_x000D_
_x000D_
    public void setQueryString(String queryString) {_x000D_
        this.queryString = queryString;_x000D_
    }_x000D_
_x000D_
    public String getUrl() {_x000D_
        return url;_x000D_
    }_x000D_
_x000D_
    public void setUrl(String url) {_x000D_
        this.url = url;_x000D_
    }_x000D_
_x000D_
    public String getMethod() {_x000D_
        return method;_x000D_
    }_x000D_
_x000D_
    public void setMethod(String method) {_x000D_
        this.method = method;_x000D_
    }_x000D_
_x000D_
    public int getConnectionTimeout() {_x000D_
        return connectionTimeout;_x000D_
    }_x000D_
_x000D_
    public void setConnectionTimeout(int connectionTimeout) {_x000D_
        this.connectionTimeout = connectionTimeout;_x000D_
    }_x000D_
_x000D_
    public int getTimeout() {_x000D_
        return timeout;_x000D_
    }_x000D_
_x000D_
    public void setTimeout(int timeout) {_x000D_
        this.timeout = timeout;_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * @return Returns the charset._x000D_
     */_x000D_
    public String getCharset() {_x000D_
        return charset;_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * @param charset The charset to set._x000D_
     */_x000D_
    public void setCharset(String charset) {_x000D_
        this.charset = charset;_x000D_
    }_x000D_
_x000D_
    public HttpResultType getResultType() {_x000D_
        return resultType;_x000D_
    }_x000D_
_x000D_
    public void setResultType(HttpResultType resultType) {_x000D_
        this.resultType = resultType;_x000D_
    }_x000D_
_x000D_
}_x000D_
