title: java.lang.IllegalArgumentException: Illegal character in path at index 33: https://box.one.th/app/api/upload
body: <p><strong>What i am doing:</strong> I am trying to make FileUploaderClient with Authorization
  <strong>I am getting error as:</strong> java.lang.IllegalArgumentException: Illegal character in path at index 33: <a href="https://box.one.th/app/api/upload" rel="nofollow noreferrer">https://box.one.th/app/api/upload</a> </p>
  
  <p><strong>FileUploaderClient</strong></p>
  
  <pre><code>   public class FileUploaderClient {
  
      public static void main(String[] args) {
  
          // the file we want to upload
          File inFile = new File("C://Users//BallZaR5R5//Desktop//nanana.docx");
          System.out.println(inFile.getAbsolutePath());
          FileInputStream fis = null;
          try {
              fis = new FileInputStream(inFile.getAbsolutePath());
  
               CloseableHttpClient httpclient = HttpClientBuilder.create().build();   
  
              // server back-end URL
              HttpPost httppost = new HttpPost("https://box.one.th/app/api/upload ");
              MultipartEntityBuilder builder = MultipartEntityBuilder.create(); 
  
  
              // set the file input stream and file name as arguments
              builder.addPart("file", new InputStreamBody(fis, inFile.getName()));
              HttpEntity entity = builder.build();
              httppost.setHeader(HttpHeaders.AUTHORIZATION,  "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9");
              httppost.setEntity(entity);
  
  
              // execute the request
              HttpResponse response = httpclient.execute(httppost);
  
              int statusCode = response.getStatusLine().getStatusCode();
              HttpEntity responseEntity = response.getEntity();
              String responseString = EntityUtils.toString(responseEntity, "UTF-8");
  
              System.out.println("[" + statusCode + "] " + responseString);
  
          } catch (ClientProtocolException e) {
              System.err.println("Unable to make connection");
              e.printStackTrace();
          } catch (IOException e) {
              System.err.println("Unable to read file");
              e.printStackTrace();
          } finally {
              try {
                  if (fis != null) fis.close();
              } catch (IOException e) {}
          }
      }
  
  
  }
  </code></pre>
  
  <p><strong>Error</strong> my console error</p>
  
  <pre><code>    Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in path at index 33: https://box.one.th/app/api/upload 
      at java.net.URI.create(Unknown Source)
      at org.apache.http.client.methods.HttpPost.&lt;init&gt;(HttpPost.java:73)
      at chaichana.sitat.test.FileUploaderClient.main(FileUploaderClient.java:37)
  Caused by: java.net.URISyntaxException: Illegal character in path at index 33: https://box.one.th/app/api/upload 
      at java.net.URI$Parser.fail(Unknown Source)
      at java.net.URI$Parser.checkChars(Unknown Source)
      at java.net.URI$Parser.parseHierarchical(Unknown Source)
      at java.net.URI$Parser.parse(Unknown Source)
      at java.net.URI.&lt;init&gt;(Unknown Source)
      ... 3 more
  </code></pre>