Commit f405e642 authored by yihua.huang's avatar yihua.huang

add default constructor for HttpRequestBody #609

parent eb376fca
......@@ -29,11 +29,14 @@ public class HttpRequestBody implements Serializable {
public static final String MULTIPART = "multipart/form-data";
}
private final byte[] body;
private byte[] body;
private final String contentType;
private String contentType;
private final String encoding;
private String encoding;
public HttpRequestBody() {
}
public HttpRequestBody(byte[] body, String contentType, String encoding) {
this.body = body;
......@@ -49,6 +52,18 @@ public class HttpRequestBody implements Serializable {
return encoding;
}
public void setBody(byte[] body) {
this.body = body;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public void setEncoding(String encoding) {
this.encoding = encoding;
}
public static HttpRequestBody json(String json, String encoding) throws UnsupportedEncodingException {
return new HttpRequestBody(json.getBytes(encoding), ContentType.JSON, encoding);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment