Interface HttpRequestBuilder

All Superinterfaces:
HttpMessageBuilder<HttpRequestBuilder,HttpRequest>

@Experimental @NoImplement @MinMuleVersion("4.10.0") public interface HttpRequestBuilder extends HttpMessageBuilder<HttpRequestBuilder,HttpRequest>
Builder of HttpRequests. Instances can only be obtained using HttpService.requestBuilder(). At the very least, the request URI needs to be provided via uri(String). By default, GET is used as method with empty headers, query params and entity.
Since:
0.12.0
  • Method Details

    • uri

      Declares the URI where this HttpRequest will be sent. Minimum required configuration.
      Parameters:
      uri - the URI (as a String) of the HttpRequest desired. Non null.
      Returns:
      this builder
    • uri

      Declares the URI where this HttpRequest will be sent. Minimum required configuration.
      Parameters:
      uri - the URI of the HttpRequest desired. Non null.
      Returns:
      this builder
    • method

      HttpRequestBuilder method(String method)
      Allows for using extension methods, as defined in the rfc. In general, method(Method) should be used.
      Parameters:
      method - the HTTP method of the HttpRequest desired. Non null.
      Returns:
      this builder
    • method

      Parameters:
      method - the HTTP method of the HttpRequest desired. Non null.
      Returns:
      this builder
    • protocol

      Parameters:
      protocol - the HTTP protocol of the HttpRequest desired. Non null.
      Returns:
      this builder
    • queryParams

      HttpRequestBuilder queryParams(org.mule.runtime.api.util.MultiMap<String,String> queryParams)
      Parameters:
      queryParams - a MultiMap representing the HTTP query params of the HttpRequest desired. Non null.
      Returns:
      this builder
    • addQueryParam

      HttpRequestBuilder addQueryParam(String name, String value)
      Includes a new queryParam to be sent in the desired HttpRequest.
      Parameters:
      name - the name of the HTTP queryParam
      value - the value of the HTTP queryParam
      Returns:
      this builder
    • getUri

      URI getUri()
      Returns:
      the current URI configured in the builder.
    • getMethod

      String getMethod()
      Returns:
      the current HTTP method configured in the builder.
    • getQueryParams

      org.mule.runtime.api.util.MultiMap<String,String> getQueryParams()
      Returns:
      an immutable version of the current query parameters in the builder.