Interface HttpWebRequest.Builder<B extends HttpWebRequest.Builder>

Type Parameters:
B - the extended Builder. For example, FormHttpRequest.Builder.
All Known Subinterfaces:
FormHttpRequest.Builder
Enclosing interface:
HttpWebRequest

public static interface HttpWebRequest.Builder<B extends HttpWebRequest.Builder>
Builds an HttpWebRequest.
  • Method Details

    • withMethod

      B withMethod(HttpMethod method)
      Specifies the HTTP method of the request. If not specified, requests with a setBody method default to POST and all other requests default to GET.
      Parameters:
      method - HTTP method
      Returns:
      this HttpWebRequest.Builder
    • withHeader

      B withHeader(String name, String value)
      Specifies an HTTP request header. Each call with the same name adds to the List of already specified values. Use only the following request headers with withHeader:
      Parameters:
      name - header name. Cannot be null or empty.
      value - header value. Cannot be null.
      Returns:
      this HttpWebRequest.Builder
    • withPath

      B withPath(String path)
      Appends the given path to the base URL.
      Parameters:
      path - path to append. Cannot be null.
      Returns:
      this HttpWebRequest.Builder
    • withQuerystringParam

      B withQuerystringParam(String name, String value)
      Specifies a query string param.
      Parameters:
      name - query string param name. Cannot be null or empty.
      value - query string param value. Cannot be null.
      Returns:
      this HttpWebRequest.Builder
    • withTimeout

      B withTimeout(int timeout)
      Specifies the maximum time in milliseconds to wait for this HTTP request to complete execution. Must be greater than 0.
      Parameters:
      timeout - timeout in milliseconds
      Returns:
      this HttpWebRequest.Builder
    • withTokenRequest

      B withTokenRequest(TokenRequest tokenRequest)
      Specifies the custom tokens that should be resolved in headers, body parameters, and body.

      For these tokens to be resolved, token resolution must be enabled with withResolveTokens(boolean).

      Parameters:
      tokenRequest - , the token request containing the mapping from token names to their values. Cannot be null.
      Returns:
      this HttpWebRequest.Builder
    • withResolveTokens

      B withResolveTokens(boolean resolveTokens)
      Specifies whether to resolve tokens used in headers, body parameters, and body. Tokens used in query string parameters are not resolved.

      By default, tokens are not resolved. You must call this method to resolve tokens.

      Parameters:
      resolveTokens - true if tokens have to be resolved, otherwise false
      Returns:
      this HttpWebRequest.Builder
    • withConnectionName

      B withConnectionName(String connectionName)
      Specify a connectionName (local, Vault to Vault, or external connection). Either connectionName or requestContextUserType is required to create a Http request
      Parameters:
      connectionName - name of a local, Vault to Vault, or external connection. Must be a connection with "active" lifecycle state. Cannot be null or empty.
      Returns:
      this HttpWebRequest.Builder
    • withLocalConnection

      B withLocalConnection(RequestContextUserType requestContextUserType)
      Specify a RequestContextUserType to represent a local connection to the current vault as the provided user type. Either requestContextUserType or connectionName is required to create a Http request
      Parameters:
      requestContextUserType -
      Returns:
      this HttpWebRequest.Builder