com.github.xiaoyuge5201.http.HttpClient Maven / Gradle / Ivy
package com.github.xiaoyuge5201.http;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
*
* @author billtsang
*
*/
public class HttpClient {
Map parameter = new HashMap();
HttpServletResponse response;
public HttpClient(HttpServletResponse response) {
this.response = response;
}
public void setParameter(String key, String value) {
this.parameter.put(key, value);
}
public void sendByPost(String url) throws IOException {
this.response.setContentType("text/html");
PrintWriter out = this.response.getWriter();
out.println("");
out.println("");
out.println(" sender ");
out.println(" ");
out.println("