public class Connection extends Object implements Closeable
| Constructor and Description |
|---|
Connection(URL url)
Make sure to wrap with a try-with-resource to ensure that the connection is closed after usage.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Response |
get(Request request)
Sends the request with method GET.
|
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 Connection(URL url)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic Response get(Request request) throws IOException
IOExceptionpublic Response post(Request request) throws IOException
IOExceptionpublic Response put(Request request) throws IOException
IOExceptionpublic Response send(String httpMethod, Request request) throws IOException
IOExceptionCopyright © 2018. All rights reserved.