|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.splunk.HttpService
public class HttpService
The HttpService
class represents a generic HTTP service at a given
address (host:port
), accessed using a given protocol scheme
(http
or https
).
Constructor Summary | |
---|---|
HttpService()
Constructs a new HttpService instance. |
|
HttpService(java.lang.String host)
Constructs a new HttpService instance at the given host. |
|
HttpService(java.lang.String host,
int port)
Constructs a new HttpService instance at the given host and port. |
|
HttpService(java.lang.String host,
int port,
java.lang.String scheme)
Constructs a new HttpService instance using the given host,
port, and scheme. |
|
HttpService(java.lang.String host,
int port,
java.lang.String scheme,
java.net.URLStreamHandler httpsHandler)
Constructs a new HttpService instance using the given host,
port, and scheme, and instructing it to use the specified HTTPS handler. |
Method Summary | |
---|---|
ResponseMessage |
delete(java.lang.String path)
Issues a DELETE request against the service using a given path. |
ResponseMessage |
delete(java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> args)
Issues a DELETE request against the service using a given path and query arguments. |
ResponseMessage |
get(java.lang.String path)
Issues an HTTP GET request against the service using a given path. |
ResponseMessage |
get(java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> args)
Issues an HTTP GET request against the service using a given path and query arguments. |
java.lang.String |
getHost()
Returns the host name of this service. |
int |
getPort()
Returns the port number of this service. |
java.lang.String |
getPrefix()
Returns the URL prefix of this service, consisting of scheme://host[:port] . |
java.lang.String |
getScheme()
Returns the scheme used by this service. |
java.net.URL |
getUrl(java.lang.String path)
Constructs a fully-qualified URL for this service using a given path. |
ResponseMessage |
post(java.lang.String path)
Issues a POST request against the service using a given path. |
ResponseMessage |
post(java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> args)
Issues a POST request against the service using a given path and form arguments. |
ResponseMessage |
send(java.lang.String path,
RequestMessage request)
Issue an HTTP request against the service using a given path and request message. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpService()
HttpService
instance.
public HttpService(java.lang.String host)
HttpService
instance at the given host.
host
- The host name of the service.public HttpService(java.lang.String host, int port)
HttpService
instance at the given host and port.
host
- The host name of the service.port
- The port number of the service.public HttpService(java.lang.String host, int port, java.lang.String scheme)
HttpService
instance using the given host,
port, and scheme.
host
- The host name of the service.port
- The port number of the service.scheme
- Scheme for accessing the service (http
or
https
).public HttpService(java.lang.String host, int port, java.lang.String scheme, java.net.URLStreamHandler httpsHandler)
HttpService
instance using the given host,
port, and scheme, and instructing it to use the specified HTTPS handler.
host
- The host name of the service.port
- The port number of the service.scheme
- Scheme for accessing the service (http
or
https
).Method Detail |
---|
public ResponseMessage get(java.lang.String path)
path
- The request path.
public ResponseMessage get(java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> args)
path
- The request path.args
- The query arguments.
public java.lang.String getHost()
public int getPort()
public java.lang.String getPrefix()
scheme://host[:port]
.
public java.lang.String getScheme()
public java.net.URL getUrl(java.lang.String path)
path
- The path to qualify.
public ResponseMessage post(java.lang.String path)
path
- The request path.
public ResponseMessage post(java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> args)
path
- The request path.args
- The form arguments.
public ResponseMessage delete(java.lang.String path)
path
- The request path.
public ResponseMessage delete(java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> args)
path
- The request path.args
- The query arguments.
public ResponseMessage send(java.lang.String path, RequestMessage request)
path
- The request path.request
- The request message.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |