UTF8 Convert
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package com.bdwise.prometheus.client.builder;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -23,7 +25,11 @@ public class InstantQueryBuilder implements QueryBuilder {
|
||||
}
|
||||
|
||||
public InstantQueryBuilder withQuery(String query) {
|
||||
params.put(QUERY_STRING, query);
|
||||
try {
|
||||
params.put(QUERY_STRING, URLEncoder.encode(query, "utf-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.bdwise.prometheus.client.builder;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -22,7 +24,11 @@ public class RangeQueryBuilder implements QueryBuilder {
|
||||
}
|
||||
|
||||
public RangeQueryBuilder withQuery(String query) {
|
||||
params.put(QUERY_STRING, query);
|
||||
try {
|
||||
params.put(QUERY_STRING, URLEncoder.encode(query, "utf-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user