Skip to content

HttpClient

class io.github.jwdeveloper.tiktok.client.http.HttpClient

@AllArgsConstructor
@Getter
public class HttpClient
  • bodyPublisher (HttpRequest.BodyPublisher, getter)
  • httpClientFactory (HttpClientFactory, getter)
  • httpClientSettings (HttpClientSettings, getter)
  • pattern (Pattern, getter)
  • url (String, getter)
  • Lombok @AllArgsConstructor generates a constructor taking every field.
public HttpClient(HttpClientSettings httpClientSettings, String url, HttpRequest.BodyPublisher bodyPublisher)
  • httpClientSettings (HttpClientSettings)
  • url (String)
  • bodyPublisher (HttpRequest.BodyPublisher)
public HttpRequest prepareRequest()

HttpRequest — HttpRequest with default GET, otherwise POST if bodyPublisher is not null

public ActionResult<byte[]> toBinaryResponse()

ActionResult<byte[]>

public <T> ActionResult<HttpResponse<T>> toHttpResponse(HttpResponse.BodyHandler<T> handler)
  • handler (HttpResponse.BodyHandler<T>)

ActionResult<HttpResponse<T>>

public ActionResult<String> toJsonResponse()

ActionResult<String>

public URI toUri()

URI

Client/src/main/java/io/github/jwdeveloper/tiktok/client/http/HttpClient.java:38