Added UTF-8 encoding to HTTP POST
This commit is contained in:
2
pom.xml
2
pom.xml
@ -19,7 +19,7 @@
|
|||||||
</developers>
|
</developers>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<log4j.version>2.10.0</log4j.version>
|
<log4j.version>2.11.0</log4j.version>
|
||||||
<httpcomponents.version>4.5.5</httpcomponents.version>
|
<httpcomponents.version>4.5.5</httpcomponents.version>
|
||||||
</properties>
|
</properties>
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -8,7 +8,6 @@ import java.util.Objects;
|
|||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.http.Consts;
|
import org.apache.http.Consts;
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.HttpResponse;
|
import org.apache.http.HttpResponse;
|
||||||
import org.apache.http.NameValuePair;
|
import org.apache.http.NameValuePair;
|
||||||
import org.apache.http.client.fluent.Form;
|
import org.apache.http.client.fluent.Form;
|
||||||
@ -301,6 +300,7 @@ public class JPushover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HttpPost httpPost = new HttpPost(Constants.MESSAGES_URL.toString());
|
HttpPost httpPost = new HttpPost(Constants.MESSAGES_URL.toString());
|
||||||
|
httpPost.addHeader("Content-Type", "text/html; charset=UTF-8");
|
||||||
|
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
|
||||||
builder.addTextBody(Constants.TOKEN.toString(), this.pushoverToken);
|
builder.addTextBody(Constants.TOKEN.toString(), this.pushoverToken);
|
||||||
@ -356,9 +356,7 @@ public class JPushover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
builder.addTextBody(Constants.SOUND.toString(), this.pushoverHtml ? "1" : "0");
|
builder.addTextBody(Constants.SOUND.toString(), this.pushoverHtml ? "1" : "0");
|
||||||
|
httpPost.setEntity(builder.build());
|
||||||
HttpEntity multipart = builder.build();
|
|
||||||
httpPost.setEntity(multipart);
|
|
||||||
|
|
||||||
JPushoverResponse jPushoverResponse = new JPushoverResponse().isSuccessful(false);
|
JPushoverResponse jPushoverResponse = new JPushoverResponse().isSuccessful(false);
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user