Using Core
Installing
Code Example
The main class of this module is com.lordofthejars.diferencia.core.Diferencia
which is the entrypoint that deals with Diferencia.
Example.java
final DiferenciaConfiguration.Builder configurationBuilder =
new DiferenciaConfiguration
.Builder("http://now.httpbin.org", "http://now.httpbin.org")
.withSecondary("http://now.httpbin.org").withNoiseDetection(true); (1)
diferencia = new Diferencia(configurationBuilder); (2)
diferencia.start(); (3)
final String diferenciaUrl = diferencia.getDiferenciaUrl(); (4)
final Response response = sendRequest(diferenciaUrl, "/"); (5)
diferencia.close(); (6)
1 | Configuration parameters |
2 | Instantiate Diferencia with given configuration |
3 | Start Diferencia and wait until it is up and running. |
4 | Gets URL to send requests |
5 | Sends a request to Diferencia. |
6 | Last you need to stop Diferencia |
You don’t need to download anything manually, everything is automatically installed. |