title: How to make a RESTful call using Basic Authentication in apache camel?
body: <p>I have an apache camel application that requires sending log files to an endpoint and this requires Basic Authentication. I was able to pass the authMethod, authusername and authPassword to the url as specified in the camel documentation but the challange I'm having is that I keep getting null response from the endpoint after starting the application. 
  However, the same endpoint returns response code and response body using postman. </p>
  
  <p>Below is my code:</p>
  
  <pre><code>from("{{routes.feeds.working.directory}}?idempotent=true")
                  .process(new Processor() {
              @Override
              public void process(Exchange exchange) throws Exception {
                      MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
                      multipartEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
                      String fileName = exchange.getIn().getHeader(Exchange.FILE_NAME, String.class);
                      File file = exchange.getIn().getBody(File.class);
                      multipartEntityBuilder.addPart("file",
                              new FileBody(file, ContentType.MULTIPART_FORM_DATA, fileName));
                      exchange.getOut().setBody(multipartEntityBuilder.build());
                      Message out = exchange.getOut();
                      int responseCode = out.getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class);
                      log.info("response code "+responseCode);
  
              }
          })
                  .setHeader(Exchange.HTTP_QUERY, 
              constant("authMethod=Basic&amp;authUsername="+username+"&amp;authPassword="+password+""))
                  .to(TARGET_WITH_AUTH +"/"+uuid+"/files")
                  .log(LoggingLevel.DEBUG, "response code &gt;&gt;&gt;&gt;"+Exchange.HTTP_RESPONSE_CODE)
                  .log(LoggingLevel.INFO, "RESPONSE BODY ${body}")
                  .end();
  </code></pre>
  
  <p>Kindly help review and advise further</p>