Hi,
Bad RequestBad Request - Invalid URL
HTTP Error 400. The request URL is invalid.
The Url we set as EndPoint to Aspose is
https://api.aspose.com/v1.1/words/阿德里安娜鲁伊斯/executeTemplate?cleanup=ContainingFields,EmptyParagraphs,UnusedFields,UnusedRegions,RemoveTitleRow,RemoveTitleRowInInnerTables&appSID=e8c4f52b-f08b-456f-ad91-6ec71c2a1896&signature=C2E%2BmrFIeDNUF6z%2Fv1TJOKVsgWI(Please have a look at the green highlighted mark in the Url and it is in Chinese.
The source code we used to send request to Aspose is as follows.
public static Blob ProcessCommand(String strURI, String strHttpCommand, String ContentType) { try { HttpRequest request = new HttpRequest(); Integer len = 0;
request.setEndpoint(strURI); request.setMethod(strHttpCommand); if (ContentType.toLowerCase() == 'xml'){ request.setHeader('Content-Type', 'application/xml'); }else if (ContentType.toLowerCase() == 'json'){ request.setHeader('Content-Type', 'application/json'); }else{ request.setHeader('Content-Type', 'MultiPart/Form-Data'); } request.setHeader('Content-Length', String.valueOf(len)); request.setHeader('Accept', 'application/json'); request.setTimeout(99999); if(TEST.isRunningTest() ){ return Blob.valueOf('This is for Test'); } else{ Http http = new Http(); HttpResponse res = http.send(request); return res.getBodyAsBlob(); } } catch (Exception ex) { system.debug('HTTP ERROR' + ex.getMessage()); throw new DataSourceException('ASPOSE Service Exception : '+ex); return null; } }</font></span></pre><pre class="codeBlock" style=""><font face="Courier New, Courier, mono"><span style="font-size: 12px; background-color: rgb(255, 255, 255);">Can you please tell me whether Url can have chinese character like i showed above? </span></font></pre><pre class="codeBlock" style=""><font face="Courier New, Courier, mono"><span style="font-size: 12px; background-color: rgb(255, 255, 255);">If so, can you please tell me how to modify my code in a way it will support Url with chinese characters?</span></font></pre><pre class="codeBlock" style=""><font face="Courier New, Courier, mono"><span style="font-size: 12px; background-color: rgb(255, 255, 255);"><br></span></font></pre><pre class="codeBlock" style=""><font face="Courier New, Courier, mono"><span style="font-size: 12px; background-color: rgb(255, 255, 255);">Thanks.</span></font></pre><pre class="codeBlock" style=""><font face="Courier New, Courier, mono"><span style="font-size: 12px; background-color: rgb(255, 255, 255);"><br></span></font></pre><pre class="codeBlock" style=""><font face="Courier New, Courier, mono"><span style="font-size: 12px; background-color: rgb(255, 255, 255);"><br></span></font></pre></pre></div>