File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -46,4 +46,4 @@ version = 1 # This must be parsable as an int
46
46
47
47
# The version as the user will see it. If blank, the version attribute will be
48
48
# used here.
49
- prettyVersion = 0.1.1 # This is treated as a String
49
+ prettyVersion = 0.1.2 # This is treated as a String
Original file line number Diff line number Diff line change @@ -26,11 +26,18 @@ public class PostRequest
26
26
HashMap <String ,File > nameFilePairs ;
27
27
28
28
String content ;
29
+ String encoding ;
29
30
HttpResponse response ;
30
31
31
- public PostRequest (String url )
32
+ public PostRequest (String url )
33
+ {
34
+ this (url , "ISO-8859-1" );
35
+ }
36
+
37
+ public PostRequest (String url , String encoding )
32
38
{
33
39
this .url = url ;
40
+ this .encoding = encoding ;
34
41
nameValuePairs = new ArrayList <BasicNameValuePair >();
35
42
nameFilePairs = new HashMap <String ,File >();
36
43
}
@@ -57,7 +64,7 @@ public void send()
57
64
HttpPost httpPost = new HttpPost (url );
58
65
59
66
if (nameFilePairs .isEmpty ()) {
60
- httpPost .setEntity (new UrlEncodedFormEntity (nameValuePairs ));
67
+ httpPost .setEntity (new UrlEncodedFormEntity (nameValuePairs , encoding ));
61
68
} else {
62
69
MultipartEntity mentity = new MultipartEntity ();
63
70
Iterator <Entry <String ,File >> it = nameFilePairs .entrySet ().iterator ();
You can’t perform that action at this time.
0 commit comments