Interface SdkHttpRequest.Builder

    • Method Detail

      • port

        SdkHttpRequest.Builder port​(Integer port)
        Configure a SdkHttpRequest.port() to be used in the created HTTP request. This is not validated until the http request is created. In order to simplify mapping from a URI, "-1" will be treated as "null" when the http request is created.
      • encodedPath

        SdkHttpRequest.Builder encodedPath​(String path)
        Configure an SdkHttpRequest.encodedPath() to be used in the created HTTP request. This is not validated until the http request is created. This path MUST be URL encoded.

        Justification of requirements: The path must be encoded when it is configured, because there is no way for the HTTP implementation to distinguish a "/" that is part of a resource name that should be encoded as "%2F" from a "/" that is part of the actual path.

      • putRawQueryParameter

        default SdkHttpRequest.Builder putRawQueryParameter​(String paramName,
                                                            String paramValue)
        Add a single un-encoded query parameter to be included in the created HTTP request.

        This completely OVERRIDES any values already configured with this parameter name in the builder.

        Parameters:
        paramName - The name of the query parameter to add
        paramValue - The un-encoded value for the query parameter.
      • appendRawQueryParameter

        SdkHttpRequest.Builder appendRawQueryParameter​(String paramName,
                                                       String paramValue)
        Add a single un-encoded query parameter to be included in the created HTTP request.

        This will ADD the value to any existing values already configured with this parameter name in the builder.

        Parameters:
        paramName - The name of the query parameter to add
        paramValue - The un-encoded value for the query parameter.
      • putRawQueryParameter

        SdkHttpRequest.Builder putRawQueryParameter​(String paramName,
                                                    List<String> paramValues)
        Add a single un-encoded query parameter with multiple values to be included in the created HTTP request.

        This completely OVERRIDES any values already configured with this parameter name in the builder.

        Parameters:
        paramName - The name of the query parameter to add
        paramValues - The un-encoded values for the query parameter.
      • rawQueryParameters

        SdkHttpRequest.Builder rawQueryParameters​(Map<String,​List<String>> queryParameters)
        Configure an SdkHttpRequest.rawQueryParameters() to be used in the created HTTP request. This is not validated until the http request is created. This overrides any values currently configured in the builder. The query parameters MUST NOT be URL encoded.

        Justification of requirements: The query parameters must not be encoded when they are configured because some HTTP implementations perform this encoding automatically.

      • removeQueryParameter

        SdkHttpRequest.Builder removeQueryParameter​(String paramName)
        Remove all values for the requested query parameter from this builder.
      • clearQueryParameters

        SdkHttpRequest.Builder clearQueryParameters()
        Removes all query parameters from this builder.
      • forEachRawQueryParameter

        default void forEachRawQueryParameter​(BiConsumer<? super String,​? super List<String>> consumer)
      • numRawQueryParameters

        default int numRawQueryParameters()
      • encodedQueryParameters

        default Optional<String> encodedQueryParameters()
      • putHeader

        default SdkHttpRequest.Builder putHeader​(String headerName,
                                                 String headerValue)
        Add a single header to be included in the created HTTP request.

        This completely OVERRIDES any values already configured with this header name in the builder.

        Parameters:
        headerName - The name of the header to add (eg. "Host")
        headerValue - The value for the header
      • putHeader

        SdkHttpRequest.Builder putHeader​(String headerName,
                                         List<String> headerValues)
        Add a single header with multiple values to be included in the created HTTP request.

        This completely OVERRIDES any values already configured with this header name in the builder.

        Parameters:
        headerName - The name of the header to add
        headerValues - The values for the header
      • appendHeader

        SdkHttpRequest.Builder appendHeader​(String headerName,
                                            String headerValue)
        Add a single header to be included in the created HTTP request.

        This will ADD the value to any existing values already configured with this header name in the builder.

        Parameters:
        headerName - The name of the header to add
        headerValue - The value for the header