Closed GoogleCodeExporter closed 8 years ago
Looking into it...
Original comment by subwiz
on 7 Dec 2012 at 1:21
Fix:
-------------------------------------------------------------
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- HEAD
+++ Modified In Working Tree
@@ -77,21 +77,24 @@
return sb.toString();
}
- static AbstractHttpEntity getEntity(ReqEntitySimple bean) throws
UnsupportedEncodingException, IOException {
+ static AbstractHttpEntity getEntity(ReqEntitySimple bean)
+ throws UnsupportedEncodingException, IOException {
AbstractHttpEntity entity = null;
- if(bean instanceof ReqEntityString) {
- entity = new StringEntity(((ReqEntityString)bean).getBody());
+ ContentType contentType = null;
+ if (bean.getContentType() != null) {
+ org.wiztools.restclient.bean.ContentType ct =
bean.getContentType();
+ contentType = ContentType.create(ct.getContentType(),
ct.getCharset());
}
- else if(bean instanceof ReqEntityByteArray) {
- entity = new ByteArrayEntity(((ReqEntityByteArray)bean).getBody());
+ if (bean instanceof ReqEntityString) {
+ entity = new StringEntity(((ReqEntityString) bean).getBody(),
contentType);
+ } else if (bean instanceof ReqEntityByteArray) {
+ entity = new ByteArrayEntity(((ReqEntityByteArray)
bean).getBody(), contentType);
+ } else if (bean instanceof ReqEntityStream) {
+ entity = new InputStreamEntity(((ReqEntityStream) bean).getBody(),
+ ((ReqEntityStream) bean).getLength(), contentType);
+ } else if (bean instanceof ReqEntityFile) {
+ entity = new FileEntity(((ReqEntityFile) bean).getBody(),
contentType);
}
- else if(bean instanceof ReqEntityStream) {
- entity = new InputStreamEntity(((ReqEntityStream)bean).getBody(),
- ((ReqEntityStream)bean).getLength());
- }
- else if(bean instanceof ReqEntityFile) {
- entity = new FileEntity(((ReqEntityFile)bean).getBody());
- }
return entity;
}
}
-------------------------------------------------------------
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- HEAD
+++ Modified In Working Tree
@@ -280,10 +280,6 @@
try {
if(bean instanceof ReqEntitySimple) {
AbstractHttpEntity e = HTTPClientUtil.getEntity((ReqEntitySimple)bean);
- final ContentType ct =
((ReqEntitySimple)bean).getContentType();
- if(ct != null) {
-
e.setContentType(HttpUtil.getFormattedContentType(ct));
- }
eeMethod.setEntity(e);
}
else if(bean instanceof ReqEntityMultipart) {
-------------------------------------------------------------
Original comment by maxima...@gmail.com
on 20 Dec 2012 at 9:08
wow! Let me try it out in the evening. Can u attach the patch to ur comment?
Original comment by subwiz
on 20 Dec 2012 at 9:15
I applied the change. But I still I am getting code-points for this URL (valid
for 24 hours after this post):
http://web-tester.appspot.com/view/abc
Original comment by subwiz
on 23 Dec 2012 at 2:14
Sorry, my last comment was based on a bug in my web-tester app. But request you
to test if my patch application has been correct.
Original comment by subwiz
on 23 Dec 2012 at 2:21
Marking as fixed. Did a quick test using request-trace-servlet (available @
WizTools.org mini-projects) and seems to be working.
Original comment by subwiz
on 27 May 2013 at 10:27
Original issue reported on code.google.com by
jbeja...@gmail.com
on 5 Dec 2012 at 9:19