Module bus.http

Class GetBuilder


public class GetBuilder extends RequestBuilder<GetBuilder>
A builder for creating HTTP GET requests using a fluent interface. This class allows for setting the URL, query parameters, headers, a tag, and a request ID.
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • GetBuilder

      public GetBuilder(Httpd httpd)
      Constructs a new GetBuilder.
      Parameters:
      httpd - The Httpd client instance.
  • Method Details

    • build

      public RequestCall build()
      Builds the RequestCall for the GET request. If any query parameters have been added, they will be appended to the URL.
      Specified by:
      build in class RequestBuilder<GetBuilder>
      Returns:
      A RequestCall object ready to be executed.
    • append

      protected String append(String url, Map<String,String> params)
      Appends the given query parameters to the URL string.
      Parameters:
      url - The original URL.
      params - The map of query parameters to append.
      Returns:
      The new URL with the appended query parameters.