 <p>Thanks paul,</p> <p>I've read through and do another round of research for this and I was using</p> <pre><code>String url ="http://someurl.com/passfail?parameter={"data1":"123456789","data2":"123456789"}"; String encodedURL = URIUtil.encodeQuery(url); </code></pre> <p>and it gave me status 200, which is a success.</p> <p>The API I used was from <strong>org.apache.commons.httpclient.util.URIUtil</strong>.</p>