Package API
Class APIService
java.lang.Object
API.APIService
Class to make api calls
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intapiDELETENode(String url, String address)Specific post method to publish a node to the OnionRouterServerstatic StringapiGETRequest(String url)Method to make GET requeststatic intapiPOSTNode(String url, String address)Specific post method to publish a node to the OnionRouterServer
-
Constructor Details
-
APIService
public APIService()
-
-
Method Details
-
apiGETRequest
Method to make GET request- Parameters:
url- url to the wanted host- Returns:
- the response from the host
- Throws:
Exception- if a connection could not be established
-
apiPOSTNode
Specific post method to publish a node to the OnionRouterServer- Parameters:
url- the target urladdress- the ip and port of the node- Returns:
- response code from server
- Throws:
Exception- if the connection cannot be established
-
apiDELETENode
Specific post method to publish a node to the OnionRouterServer- Parameters:
url- the target urladdress- the ip and port of the node- Returns:
- response code from server
- Throws:
IOException- if the connection cannot be established
-