All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.xiaoyuge5201.http.HttpClient Maven / Gradle / Ivy

There is a newer version: 1.3.5
Show newest version
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("
"); Iterator it = this.parameter.keySet().iterator(); while (it.hasNext()) { String key = it.next(); out.println(""); } out.println(""); out.println(" "); out.println(" "); out.println(""); out.flush(); out.close(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy