code: protected String createCanonicalRequest(SignableRequest<?> request,
              String contentSha256) {
          /* This would url-encode the resource path for the first time. */
          final String path = SdkHttpUtils.appendUri(
                  request.getEndpoint().getPath(), request.getResourcePath());
  
          final StringBuilder canonicalRequestBuilder = new StringBuilder(request
                  .getHttpMethod().toString());
  
          canonicalRequestBuilder.append(LINE_SEPARATOR)
                  // This would optionally double url-encode the resource path
                  .append(getCanonicalizedResourcePath(path, doubleUrlEncode))
                  .append(LINE_SEPARATOR)
                  .append(getCanonicalizedQueryString(request))
                  .append(LINE_SEPARATOR)
                  .append(getCanonicalizedHeaderString(request))
                  .append(LINE_SEPARATOR)
                  .append(getSignedHeadersString(request)).append(LINE_SEPARATOR)
                  .append(contentSha256);
  
          final String canonicalRequest = canonicalRequestBuilder.toString();
  
          if (log.isDebugEnabled())
              log.debug("AWS4 Canonical Requests: '\"" + canonicalRequest + "\"");
  
          return canonicalRequest;
      }
docs: Step 1 of the AWS Signature version 4 calculation. Refer to
  http://docs.aws
  .amazon.com/general/latest/gr/sigv4-create-canonical-request.html to
  generate the canonical request.