Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2013-05-14 19:27:42 +0000
committerMarkus Alexander Kuppe2013-05-14 19:27:42 +0000
commitce36e6261a02702b4997aaaa5e99c0e732452b7b (patch)
tree51a4c59bac6afc86be140c42a06d25aa7e216971 /framework
parentd7b92a0489438acc6658683beb130283486511db (diff)
downloadorg.eclipse.ecf-ce36e6261a02702b4997aaaa5e99c0e732452b7b.tar.gz
org.eclipse.ecf-ce36e6261a02702b4997aaaa5e99c0e732452b7b.tar.xz
org.eclipse.ecf-ce36e6261a02702b4997aaaa5e99c0e732452b7b.zip
RESOLVED - bug 408030: RestClientService ignores content encoding
https://bugs.eclipse.org/bugs/show_bug.cgi?id=408030
Diffstat (limited to 'framework')
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java b/framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java
index 14cfd503b..dba71a3d2 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.rest/src/org/eclipse/ecf/remoteservice/rest/client/RestClientService.java
@@ -228,7 +228,7 @@ public class RestClientService extends AbstractClientService {
} else {
NameValuePair[] params = toNameValuePairs(uri, call, callable);
if (params != null) {
- result.setEntity(new UrlEncodedFormEntity(Arrays.asList(params)));
+ result.setEntity(getUrlEncodedFormEntity(Arrays.asList(params), putRequestType));
}
}
return result;
@@ -251,8 +251,9 @@ public class RestClientService extends AbstractClientService {
}
} else {
NameValuePair[] params = toNameValuePairs(uri, call, callable);
- if (params != null)
- result.setEntity(new UrlEncodedFormEntity(Arrays.asList(params)));
+ if (params != null) {
+ result.setEntity(getUrlEncodedFormEntity(Arrays.asList(params), postRequestType));
+ }
}
return result;
}
@@ -271,6 +272,13 @@ public class RestClientService extends AbstractClientService {
return result;
}
+ protected UrlEncodedFormEntity getUrlEncodedFormEntity(List list, AbstractEntityRequestType postRequestType) throws UnsupportedEncodingException {
+ if (postRequestType.defaultCharset != null) {
+ return new UrlEncodedFormEntity(list, postRequestType.defaultCharset);
+ }
+ return new UrlEncodedFormEntity(list);
+ }
+
protected NameValuePair[] toNameValuePairs(String uri, IRemoteCall call, IRemoteCallable callable) throws NotSerializableException {
IRemoteCallParameter[] restParameters = prepareParameters(uri, call, callable);
List nameValueList = new ArrayList();

Back to the top