Class HttpUtils


  • public class HttpUtils
    extends Object
    Utility class for HTTP-related operations.
    Author:
    andrea del bene
    • Constructor Detail

      • HttpUtils

        public HttpUtils()
    • Method Detail

      • readStringFromRequest

        public static String readStringFromRequest​(WebRequest request)
                                            throws IOException
        Read the string content of the current request.
        Parameters:
        request - the current request
        Returns:
        the string inside body request.
        Throws:
        IOException
      • getHttpMethod

        public static HttpMethod getHttpMethod​(Request request)
        Utility method to extract the HTTP request method.
        Parameters:
        request - the current request object
        Returns:
        the HTTP method used for this request
        See Also:
        HttpMethod
      • getHttpMethod

        public static HttpMethod getHttpMethod​(WebRequest request)
        Utility method to extract the HTTP request method.
        Parameters:
        request - the current request object
        Returns:
        the HTTP method used for this request
        See Also:
        HttpMethod