This commit is contained in:
@@ -86,12 +86,42 @@ public class HttpSimpleRequest implements java.io.Serializable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HttpSimpleRequest header(String key, JsonConvert convert, Object value) {
|
||||||
|
if (value == null) return this;
|
||||||
|
if (this.headers == null) this.headers = new HashMap<>();
|
||||||
|
if (convert == null) convert = JsonConvert.root();
|
||||||
|
this.headers.put(key, convert.convertTo(value));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HttpSimpleRequest header(String key, Object value) {
|
||||||
|
if (value == null) return this;
|
||||||
|
if (this.headers == null) this.headers = new HashMap<>();
|
||||||
|
this.headers.put(key, JsonConvert.root().convertTo(value));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public HttpSimpleRequest param(String key, String value) {
|
public HttpSimpleRequest param(String key, String value) {
|
||||||
if (this.params == null) this.params = new HashMap<>();
|
if (this.params == null) this.params = new HashMap<>();
|
||||||
this.params.put(key, value);
|
this.params.put(key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HttpSimpleRequest param(String key, JsonConvert convert, Object value) {
|
||||||
|
if (value == null) return this;
|
||||||
|
if (this.params == null) this.params = new HashMap<>();
|
||||||
|
if (convert == null) convert = JsonConvert.root();
|
||||||
|
this.params.put(key, convert.convertTo(value));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HttpSimpleRequest param(String key, Object value) {
|
||||||
|
if (value == null) return this;
|
||||||
|
if (this.params == null) this.params = new HashMap<>();
|
||||||
|
this.params.put(key, JsonConvert.root().convertTo(value));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public HttpSimpleRequest body(byte[] body) {
|
public HttpSimpleRequest body(byte[] body) {
|
||||||
this.body = body;
|
this.body = body;
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Reference in New Issue
Block a user