Klasse ScryfallClient

java.lang.Object
net.dzultra.jsa.ScryfallClient

public class ScryfallClient extends Object
A simple client wrapper for interacting with the Scryfall API.

This class provides a preconfigured HttpClient and HttpRequest.Builder with default headers such as User-Agent and Accept. It serves as a base for making HTTP requests to the Scryfall API.

  • Felddetails

    • httpClient

      public final HttpClient httpClient
      The HTTP client used to send requests.
    • requestBuilder

      public final HttpRequest.Builder requestBuilder
      A preconfigured request builder with default headers.
    • BASE_URL

      public static final String BASE_URL
      The base URL for all Scryfall API endpoints.
      Siehe auch:
    • userAgent

      public final String userAgent
      The User-Agent string used for all API requests.
  • Konstruktordetails

    • ScryfallClient

      public ScryfallClient(String userAgent)
      Constructs a new ScryfallClient with the specified User-Agent.

      Initializes a default HttpClient and configures the request builder with the provided User-Agent and an Accept header for JSON responses.

      Parameter:
      userAgent - the User-Agent string to include in all requests; should identify your application according to Scryfall API guidelines
  • Methodendetails

    • getBaseUrl

      public String getBaseUrl()
      Returns the base URL for the Scryfall API.
      Gibt zurück:
      the base API URL as a string
    • getUserAgent

      public String getUserAgent()
      Returns the User-Agent used by this client.
      Gibt zurück:
      the User-Agent string