Package com.aliucord
Class Http
-
- All Implemented Interfaces:
public class Http
Http Utilities
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
Http.HttpException
public class
Http.QueryBuilder
QueryString Builder
public class
Http.MultiPartBuilder
Utility to build MultiPart requests
public class
Http.Request
Request Builder
public class
Http.Response
Response obtained by calling Request.execute()
-
Constructor Summary
Constructors Constructor Description Http()
-
Method Summary
Modifier and Type Method Description static String
simpleGet(String url)
Send a simple GET request static void
simpleDownload(String url, File outputFile)
Download content from the specified url to the specified File static <T> T
simpleJsonGet(String url, Type schema)
Send a simple GET request static <T> T
simpleJsonGet(String url, Class<T> schema)
Send a simple GET request static String
simplePost(String url, String body)
Send a simple POST request static <T> T
simpleJsonPost(String url, String body, Type schema)
Send a simple POST request and parse the JSON response static <T> T
simpleJsonPost(String url, String body, Class<T> schema)
Send a simple POST request and parse the JSON response static <T> T
simpleJsonPost(String url, Object body, Type schema)
Send a simple POST request with JSON body static <T> T
simpleJsonPost(String url, Object body, Class<T> schema)
Send a simple POST request with JSON body -
-
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 fromoutputFile
- The file to save to
-
simpleJsonGet
static <T> T simpleJsonGet(String url, Type schema)
Send a simple GET request
- Parameters:
url
- The url to fetchschema
- Class to deserialize the response into
-
simpleJsonGet
static <T> T simpleJsonGet(String url, Class<T> schema)
Send a simple GET request
- Parameters:
url
- The url to fetchschema
- Class to deserialize the response into
-
simplePost
static String simplePost(String url, String body)
Send a simple POST request
- Parameters:
url
- The url to fetchbody
- 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 fetchbody
- The request bodyschema
- 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 fetchbody
- The request bodyschema
- 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 fetchbody
- The request bodyschema
- 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 fetchbody
- The request bodyschema
- Class to deserialize the response into
-
-
-
-