groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Lotz" <qoc...@gmx.de>
Subject HTTPBuilder & URIBuilder - plus sign will not encoded
Date Sun, 20 Nov 2016 13:25:23 GMT
<html><head></head><body><div style="font-family: Verdana;font-size:
12.0px;"><div><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">Hi
all,</span></div>

<div>
<div><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">I
try to&nbsp;upload&nbsp;files via HTTPBuilder (Groovy Version: 2.4.7 JVM: 1.8.0_40
Vendor: Oracle Corporation OS: Mac OS X). After a couple of test I realized, that filenames&nbsp;containing
a plus sign (&quot;+&quot;) can&#39;t be uploaded. The REST Service responds with&nbsp;HTTP/1.1
400 Bad Request. After some more debugging I think&nbsp;these filenames will not get encoded
correctly:</span></div>

<div>&nbsp;</div>

<div><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">uri.path
= &quot;/rest/&quot; + objectNamespace + &quot;/&quot; + objectFile.name</span></div>

<div>
<p><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">groovyx.net.http.HTTPBuilder
doRequest<br/>
FINE: PUT http://172.16.29.10/rest/TEST/s<strong>pace%20space.doc</strong> - Filename:
space&#92; space.doc - OK</span></p>
</div>

<div>
<p><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">groovyx.net.http.HTTPBuilder
doRequest<br/>
FINE: PUT http://172.16.29.10/rest/TEST/<strong>plus+plus.doc</strong> -Filename
plus+plus.doc - ERROR</span></p>
</div>

<div>&nbsp;</div>

<div><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">All
other &quot;special&quot; characters like spaces, #, &amp;, % or ? will get&nbsp;encoded
correctly ... </span></div>

<div>&nbsp;</div>

<div><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">Does
anybody know how to resolve this issue?</span></div>

<div>&nbsp;</div>

<div><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">Thanks
in advance</span></div>

<div><span style="font-family:lucida sans unicode,lucida grande,sans-serif;">Paolo</span></div>
</div></div></body></html>

Mime
View raw message