com.amazonaws.http.HttpMethodName.toString()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中com.amazonaws.http.HttpMethodName.toString()方法的一些代码示例,展示了HttpMethodName.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpMethodName.toString()方法的具体详情如下:
包路径:com.amazonaws.http.HttpMethodName
类名称:HttpMethodName
方法名:toString

HttpMethodName.toString介绍

暂无

代码示例

代码示例来源:origin: aws/aws-sdk-java

private S3Signer createSigV2Signer(final Request<?> request,
                    final String bucketName,
                    final String key) {
  String resourcePath = "/" +
      ((bucketName != null) ? bucketName + "/" : "") +
      ((key != null) ? key : "");
  return new S3Signer(request.getHttpMethod().toString(), resourcePath);
}

代码示例来源:origin: aws/aws-sdk-java

/**
 * 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.
 */
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 Request: '\"" + canonicalRequest + "\"");
  return canonicalRequest;
}

代码示例来源:origin: aws/aws-sdk-java

stringToSign = request.getHttpMethod().toString() + "\n"
    + getCanonicalizedResourcePath(path) + "\n"
    + getCanonicalizedQueryString(request.getParameters()) + "\n"

代码示例来源:origin: aws-amplify/aws-sdk-android

private S3Signer createSigV2Signer(final Request<?> request,
                  final String bucketName,
                  final String key) {
  final String resourcePath = "/" +
      ((bucketName != null) ? bucketName + "/" : "") +
      ((key != null) ? key : "");
  return new S3Signer(request.getHttpMethod().toString(), resourcePath);
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-core

/**
 * 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.
 */
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 Request: '\"" + canonicalRequest + "\"");
  return canonicalRequest;
}

代码示例来源:origin: aws-amplify/aws-sdk-android

headers.put("X-HTTP-Method-Override", HttpMethodName.PATCH.toString());
final HttpRequest httpRequest = new HttpRequest(method.toString(), URI.create(uri), headers,
    is);
httpRequest.setStreaming(request.isStreaming());

代码示例来源:origin: aws-amplify/aws-sdk-android

protected String getCanonicalRequest(Request<?> request, String contentSha256) {
  /* This would url-encode the resource path for the first time */
  final String path = HttpUtils.appendUri(request.getEndpoint().getPath(),
      request.getResourcePath());
  final String canonicalRequest =
      request.getHttpMethod().toString() + "\n" +
          /*
           * This would optionally double url-encode the resource
           * path
           */
          getCanonicalizedResourcePath(path, doubleUrlEncode) + "\n" +
          getCanonicalizedQueryString(request) + "\n" +
          getCanonicalizedHeaderString(request) + "\n" +
          getSignedHeadersString(request) + "\n" +
          contentSha256;
  log.debug("AWS4 Canonical Request: '\"" + canonicalRequest + "\"");
  return canonicalRequest;
}

代码示例来源:origin: aws-amplify/aws-sdk-android

stringToSign = request.getHttpMethod().toString() + "\n"
    + getCanonicalizedResourcePath(path) + "\n"
    + getCanonicalizedQueryString(request.getParameters()) + "\n"

代码示例来源:origin: com.amazonaws/aws-java-sdk-core

stringToSign = request.getHttpMethod().toString() + "\n"
    + getCanonicalizedResourcePath(path) + "\n"
    + getCanonicalizedQueryString(request.getParameters()) + "\n"

代码示例来源:origin: com.amazonaws/aws-android-sdk-s3

private S3Signer createSigV2Signer(final Request<?> request,
                  final String bucketName,
                  final String key) {
  final String resourcePath = "/" +
      ((bucketName != null) ? bucketName + "/" : "") +
      ((key != null) ? key : "");
  return new S3Signer(request.getHttpMethod().toString(), resourcePath);
}

代码示例来源:origin: Nextdoor/bender

private S3Signer createSigV2Signer(final Request<?> request,
                    final String bucketName,
                    final String key) {
  String resourcePath = "/" +
      ((bucketName != null) ? bucketName + "/" : "") +
      ((key != null) ? key : "");
  return new S3Signer(request.getHttpMethod().toString(), resourcePath);
}

代码示例来源:origin: com.netflix.rx-aws-java-sdk/rx-aws-java-sdk-core

protected String createCanonicalRequest(SignableRequest<?> request,
    String contentSha256) {
  final String path = RxSdkHttpUtils.appendUri(
      request.getEndpoint().getPath(), request.getResourcePath());
  final StringBuilder canonicalRequestBuilder = new StringBuilder(request
      .getHttpMethod().toString());
  canonicalRequestBuilder.append(LINE_SEPARATOR)
      .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 Request: '\"" + canonicalRequest + "\"");
  return canonicalRequest;
}

代码示例来源:origin: Nextdoor/bender

/**
 * 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.
 */
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 Request: '\"" + canonicalRequest + "\"");
  return canonicalRequest;
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-core

headers.put("X-HTTP-Method-Override", HttpMethodName.PATCH.toString());
final HttpRequest httpRequest = new HttpRequest(method.toString(), URI.create(uri), headers,
    is);
httpRequest.setStreaming(request.isStreaming());

代码示例来源:origin: com.gluonhq/aws-java-sdk-core

protected String getCanonicalRequest(Request<?> request, String contentSha256) {
  /* This would url-encode the resource path for the first time */
  final String path = HttpUtils.appendUri(request.getEndpoint().getPath(),
      request.getResourcePath());
  final String canonicalRequest =
      request.getHttpMethod().toString() + "\n" +
          /*
           * This would optionally double url-encode the resource
           * path
           */
          getCanonicalizedResourcePath(path, doubleUrlEncode) + "\n" +
          getCanonicalizedQueryString(request) + "\n" +
          getCanonicalizedHeaderString(request) + "\n" +
          getSignedHeadersString(request) + "\n" +
          contentSha256;
  log.debug("AWS4 Canonical Request: '\"" + canonicalRequest + "\"");
  return canonicalRequest;
}

代码示例来源:origin: com.netflix.rx-aws-java-sdk/rx-aws-java-sdk-core

HttpMethod.valueOf(request.getHttpMethod().toString()),
 sbPath.toString()
);

代码示例来源:origin: com.amazonaws/aws-android-sdk-core

protected String getCanonicalRequest(Request<?> request, String contentSha256) {
  /* This would url-encode the resource path for the first time */
  final String path = HttpUtils.appendUri(request.getEndpoint().getPath(),
      request.getResourcePath());
  final String canonicalRequest =
      request.getHttpMethod().toString() + "\n" +
          /*
           * This would optionally double url-encode the resource
           * path
           */
          getCanonicalizedResourcePath(path, doubleUrlEncode) + "\n" +
          getCanonicalizedQueryString(request) + "\n" +
          getCanonicalizedHeaderString(request) + "\n" +
          getSignedHeadersString(request) + "\n" +
          contentSha256;
  log.debug("AWS4 Canonical Request: '\"" + canonicalRequest + "\"");
  return canonicalRequest;
}

代码示例来源:origin: com.gluonhq/aws-java-sdk-core

stringToSign = request.getHttpMethod().toString() + "\n"
    + getCanonicalizedResourcePath(path) + "\n"
    + getCanonicalizedQueryString(request.getParameters()) + "\n"

代码示例来源:origin: com.amazonaws/aws-android-sdk-core

stringToSign = request.getHttpMethod().toString() + "\n"
    + getCanonicalizedResourcePath(path) + "\n"
    + getCanonicalizedQueryString(request.getParameters()) + "\n"

代码示例来源:origin: Nextdoor/bender

stringToSign = request.getHttpMethod().toString() + "\n"
    + getCanonicalizedResourcePath(path) + "\n"
    + getCanonicalizedQueryString(request.getParameters()) + "\n"

相关文章