code: private RESTResponse sendAndReceive(HttpMethod          method,
                                          String              uri,
                                          Map<String, String> headers,
                                          byte[]              body) throws IOException {
          // Add standard headers
          assert headers != null;
          headers.put(HttpDefs.HOST, m_host);
          headers.put(HttpDefs.ACCEPT, m_acceptFormat.toString());
          headers.put(HttpDefs.CONTENT_LENGTH, Integer.toString(body == null ? 0 : body.length));
          if (m_bCompress) {
              headers.put(HttpDefs.ACCEPT_ENCODING, "gzip");
          }
          if (m_credentials != null) {
              String authString =
                  "Basic " + Utils.base64FromString(m_credentials.getUserid() + ":" + m_credentials.getPassword());
              headers.put("Authorization", authString);
          }
          
          // Form the message header.
          StringBuilder buffer = new StringBuilder();
          buffer.append(method.toString());
          buffer.append(" ");
          buffer.append(addTenantParam(uri));
          buffer.append(" HTTP/1.1\r\n");
          for (String name : headers.keySet()) {
              buffer.append(name);
              buffer.append(": ");
              buffer.append(headers.get(name));
              buffer.append("\r\n");
          }
          buffer.append("\r\n");
  
          m_logger.debug("Sending request to uri '{}'; message length={}",
                         uri, headers.get(HttpDefs.CONTENT_LENGTH));
          return sendAndReceive(buffer.toString(), body);
      }
docs: Add standard headers to the given request and send it.