Class HttpClient

java.lang.Object
org.basex.util.http.HttpClient

public final class HttpClient extends Object
HTTP Client.
Author:
BaseX Team 2005-21, BSD License, Rositsa Shadura, Michael Seiferle
  • Constructor Details

    • HttpClient

      public HttpClient(InputInfo info, MainOptions options)
      Constructor.
      Parameters:
      info - input info
      options - database options
  • Method Details

    • sendRequest

      public Value sendRequest(byte[] href, ANode request, Value bodies) throws QueryException
      Sends an HTTP request and returns the response.
      Parameters:
      href - URL to send the request to
      request - request data
      bodies - request body
      Returns:
      HTTP response
      Throws:
      QueryException - query exception
    • authHeaders

      public static EnumMap<HttpText.Request,String> authHeaders(String auth)
      Returns the authentication headers.
      Parameters:
      auth - authorization string
      Returns:
      values values
    • writePayload

      public static void writePayload(OutputStream out, HttpRequest request) throws IOException
      Writes the HTTP request payload.
      Parameters:
      out - output stream
      request - request data
      Throws:
      IOException - I/O exception