Package net.bjmsw.hda.vs.autowetter
Class WebSnippets
java.lang.Object
net.bjmsw.hda.vs.autowetter.WebSnippets
The WebSnippets class provides methods for interacting with a web API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<BuchmacherOuterClass.Spiel> Retrieves a list of Spiele from the specified server URI.static StringPerforms a login using the given username and password, and returns the authentication token.static voidplaceBet(String serverUri, BuchmacherOuterClass.Wettangebot wa, int tipp, double einsatz, String token) Places a bet on the specified server using the provided parameters.
-
Constructor Details
-
WebSnippets
public WebSnippets()
-
-
Method Details
-
login
Performs a login using the given username and password, and returns the authentication token.- Parameters:
username- The username to use for logging in.password- The password to use for logging in.uri- The base URI of the server.- Returns:
- The authentication token.
- Throws:
IOException- If an I/O error occurs while performing the login.
-
getSpiele
Retrieves a list of Spiele from the specified server URI.- Parameters:
serverUri- the URI of the server where the Spiele are located- Returns:
- a list of Spiele objects retrieved from the server
- Throws:
IOException- if an I/O error occurs while making the HTTP request
-
placeBet
public static void placeBet(String serverUri, BuchmacherOuterClass.Wettangebot wa, int tipp, double einsatz, String token) Places a bet on the specified server using the provided parameters.- Parameters:
serverUri- The URI of the server to place the bet on.wa- The Wettangebot to place the bet on.tipp- The tip to place on the bet.einsatz- The amount of the bet.token- The authorization token for the request.
-