com.tapstream.rollbar.HttpRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rollbar-logback Show documentation
Show all versions of rollbar-logback Show documentation
A Rollbar logback appender that includes out of the box support for servlets
package com.tapstream.rollbar;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
public class HttpRequest {
private final URL url;
private final Map requestProperties;
private String method;
private byte[] body;
public HttpRequest(URL url, String method) {
this.url = url;
this.method = method;
this.requestProperties = new HashMap();
}
public URL getUrl(){
return url;
}
public String getMethod(){
return method;
}
public void setHeader(String key, String value) {
requestProperties.put(key, value);
}
public Map getHeaders(){
return this.requestProperties;
}
public void setBody(String body) {
try {
this.body = body.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
this.body = body.getBytes();
}
}
public byte[] getBody(){
return this.body;
}
}