Class HandlerLogin

java.lang.Object
br.net.dd.netherwingcore.bnetserver.rest.handlers.HandlerLogin
All Implemented Interfaces:
HttpHandler

public class HandlerLogin extends Object implements HttpHandler
HandlerLogin is responsible for handling requests to the /bnetserver/login/ endpoint. This endpoint is likely used for processing login requests, which may involve validating user credentials, initiating authentication processes, or providing responses related to login attempts.
  • Constructor Details

    • HandlerLogin

      public HandlerLogin()
  • Method Details

    • handle

      public void handle(HttpExchange exchange) throws IOException
      Handles incoming HTTP requests to the /bnetserver/login/ endpoint. Depending on the HTTP method (GET or POST), it processes the request accordingly. For GET requests, it initializes form inputs and sends a JSON response with the form details. For POST requests, it logs the received request and sends a simple JSON response acknowledging the POST request.
      Specified by:
      handle in interface HttpHandler
      Parameters:
      exchange - The HttpExchange object representing the incoming HTTP request and response.
      Throws:
      IOException - If an I/O error occurs while handling the request.