org.webpieces.webserver.impl.body.BodyParsers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http-webserver Show documentation
Show all versions of http-webserver Show documentation
The full webpieces server AS A library
package org.webpieces.webserver.impl.body;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
public class BodyParsers {
private Map typeToParser = new HashMap<>();
@Inject
public BodyParsers(FormUrlEncodedParser formParser) {
typeToParser.put("application/x-www-form-urlencoded", formParser);
}
public BodyParser lookup(String typeHeader) {
return typeToParser.get(typeHeader);
}
}