Class MiniClient
java.lang.Object
i5.las2peer.connectors.webConnector.client.MiniClient
Very simple client to communicate with the las2peer web connector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsendRequest(String method, String uri, String content) send request to serversendRequest(String method, String uri, String content, String contentType, String accept, Map<String, String> headers) send request to serversend request to servervoidsetAddressPort(String address, int port) Deprecated.voidsetConnectorEndpoint(String endpoint) Sets the connectors endpoint URI this client should connect to.voidset login data
-
Constructor Details
-
MiniClient
public MiniClient()
-
-
Method Details
-
setAddressPort
Deprecated.UsesetConnectorEndpoint(String)instead. set address and port- Parameters:
address- address of the serverport- if 0 no port is appended to the address
-
setConnectorEndpoint
Sets the connectors endpoint URI this client should connect to.- Parameters:
endpoint- A connector endpoint like http://localhost:12345, with no trailing slash
-
setLogin
set login data- Parameters:
username-password-
-
sendRequest
public ClientResponse sendRequest(String method, String uri, String content, String contentType, String accept, Map<String, String> headers) send request to server- Parameters:
method- POST, GET, DELETE, PUTuri- REST-URI (server address excluded)content- if POST is used information can be embedded herecontentType- value of Content-Type headeraccept- value of Accept Headerheaders- headers for HTTP request- Returns:
- returns server response
-
sendRequest
public ClientResponse sendRequest(String method, String uri, String content, Map<String, String> headers) send request to server- Parameters:
method- POST, GET, DELETE, PUTuri- REST-URI (server address excluded)content- if POST is used information can be embedded hereheaders- headers for HTTP request- Returns:
- returns server response
-
sendRequest
send request to server- Parameters:
method- POST, GET, DELETE, PUTuri- REST-URI (server address excluded)content- if POST is used information can be embedded here- Returns:
- returns server response
-
setConnectorEndpoint(String)instead.