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

com.geccocrawler.gecco.request.HttpPostRequest Maven / Gradle / Ivy

There is a newer version: 1.3.21
Show newest version
package com.geccocrawler.gecco.request;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class HttpPostRequest extends AbstractHttpRequest {

	private static final long serialVersionUID = -4451221207994730839L;

	private Map fields;
	
	public HttpPostRequest() {
		super();
		fields = new HashMap();
	}

	public HttpPostRequest(String url) {
		super(url);
		fields = new HashMap();
	}
	
	public Map getFields() {
		return fields;
	}

	public void setFields(Map fields) {
		this.fields = fields;
	}

	public void addField(String name, String field) {
		fields.put(name, field);
	}
	
	public static HttpPostRequest fromJson(JSONObject request) {
		return (HttpPostRequest)JSON.toJavaObject(request, HttpPostRequest.class);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy