class Connection extends Closeable
Sends an HTTP Request and stores the Response. Clients should not send more than
one request.
Example usage:
try (Connection connection = new Connection(url)) {
Response response = connection.get(request);
// ... process the response
}
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Connection
- Closeable
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
close(): Unit
- Definition Classes
- Connection → Closeable → AutoCloseable
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(request: Request): Response
Sends the request with method GET.
Sends the request with method GET.
- request
the request to send
- returns
the response to the sent request
- Exceptions thrown
IOExceptionif sending the request fails
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
post(request: Request): Response
Sends the request with method POST.
Sends the request with method POST.
- request
the request to send
- returns
the response to the sent request
- Exceptions thrown
IOExceptionif sending the request fails
-
def
put(request: Request): Response
Sends the request with method PUT.
Sends the request with method PUT.
- request
the request to send
- returns
the response to the sent request
- Exceptions thrown
IOExceptionif sending the request fails
-
def
send(httpMethod: String, request: Request): Response
Sends the request.
Sends the request.
- httpMethod
the HTTP request method
- request
the request to send
- returns
the response to the sent request
- Exceptions thrown
IOExceptionif building the HTTP request fails.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )