public class Connection extends Object implements Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Response |
get(Request request)
Sends the request with method GET.
|
static Function<URL,Connection> |
getConnectionFactory()
Returns a factory for
Connection. |
static Function<URL,Connection> |
getInsecureConnectionFactory()
Returns a factory for
Connection that does not verify TLS peer verification. |
Response |
post(Request request)
Sends the request with method POST.
|
Response |
put(Request request)
Sends the request with method PUT.
|
Response |
send(String httpMethod,
Request request)
Sends the request.
|
public static Function<URL,Connection> getConnectionFactory()
Connection.Connection factory, a function that generates a Connection to a URLpublic static Function<URL,Connection> getInsecureConnectionFactory() throws GeneralSecurityException
Connection that does not verify TLS peer verification.Connection factory, a function that generates a Connection to a URLGeneralSecurityException - if unable to turn off TLS peer verificationpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic Response get(Request request) throws IOException
request - the request to sendIOException - if sending the request failspublic Response post(Request request) throws IOException
request - the request to sendIOException - if sending the request failspublic Response put(Request request) throws IOException
request - the request to sendIOException - if sending the request failspublic Response send(String httpMethod, Request request) throws IOException
httpMethod - the HTTP request methodrequest - the request to sendIOException - if building the HTTP request fails.Copyright © 2019. All rights reserved.