git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
UI: progress bars fixes, update nikiroo-utils
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
Cache.java
diff --git
a/src/be/nikiroo/fanfix/Cache.java
b/src/be/nikiroo/fanfix/Cache.java
index 8e8392aa12d61795b53ce03d320e591f11b20712..d97a58a66a13a67751ea94f876e9c36c4f1b6a27 100644
(file)
--- a/
src/be/nikiroo/fanfix/Cache.java
+++ b/
src/be/nikiroo/fanfix/Cache.java
@@
-222,7
+222,7
@@
public class Cache {
throws IOException {
URLConnection conn = openConnectionWithCookies(url, support);
throws IOException {
URLConnection conn = openConnectionWithCookies(url, support);
- if (postParams != null) {
+ if (postParams != null
&& conn instanceof HttpURLConnection
) {
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : postParams.entrySet()) {
if (postData.length() != 0)
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : postParams.entrySet()) {
if (postData.length() != 0)
@@
-234,6
+234,10
@@
public class Cache {
}
conn.setDoOutput(true);
}
conn.setDoOutput(true);
+ ((HttpURLConnection) conn).setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type",
+ "application/x-www-form-urlencoded");
+ conn.setRequestProperty("charset", "utf-8");
OutputStreamWriter writer = new OutputStreamWriter(
conn.getOutputStream());
OutputStreamWriter writer = new OutputStreamWriter(
conn.getOutputStream());