Package com.aliucord

Class Http

  • All Implemented Interfaces:

    
    public class Http
    
                        

    Http Utilities

    • Constructor Detail

      • Http

        Http()
    • Method Detail

      • simpleGet

         static String simpleGet(String url)

        Send a simple GET request

        Parameters:
        url - The url to fetch
      • simpleDownload

         static void simpleDownload(String url, File outputFile)

        Download content from the specified url to the specified File

        Parameters:
        url - The url to download content from
        outputFile - The file to save to
      • simpleJsonGet

         static <T> T simpleJsonGet(String url, Type schema)

        Send a simple GET request

        Parameters:
        url - The url to fetch
        schema - Class to deserialize the response into
      • simplePost

         static String simplePost(String url, String body)

        Send a simple POST request

        Parameters:
        url - The url to fetch
        body - The request body
      • simpleJsonPost

         static <T> T simpleJsonPost(String url, String body, Type schema)

        Send a simple POST request and parse the JSON response

        Parameters:
        url - The url to fetch
        body - The request body
        schema - Class to deserialize the response into
      • simpleJsonPost

         static <T> T simpleJsonPost(String url, String body, Class<T> schema)

        Send a simple POST request and parse the JSON response

        Parameters:
        url - The url to fetch
        body - The request body
        schema - Class to deserialize the response into
      • simpleJsonPost

         static <T> T simpleJsonPost(String url, Object body, Type schema)

        Send a simple POST request with JSON body

        Parameters:
        url - The url to fetch
        body - The request body
        schema - Class to deserialize the response into
      • simpleJsonPost

         static <T> T simpleJsonPost(String url, Object body, Class<T> schema)

        Send a simple POST request with JSON body

        Parameters:
        url - The url to fetch
        body - The request body
        schema - Class to deserialize the response into