Klasse HttpRequest
java.lang.Object
de.oliver.fancyanalytics.api.http.HttpRequest
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungHttpRequest(String url) Creates a new HttpRequest.Creates a new HttpRequest. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetBody()getUrl()send()Sends the request to the server.Sets the body of the request.withHeader(String key, String value) Adds a header to the request.withHeaders(Map<String, String> headers) Sets the headers of the request.withMethod(String method) Sets the method of the request.
-
Konstruktordetails
-
HttpRequest
Creates a new HttpRequest.- Parameter:
url- The url to send the request to.method- The method to use.body- The body of the request.headers- The headers of the request.
-
HttpRequest
Creates a new HttpRequest.
-
-
Methodendetails
-
send
Sends the request to the server.- Gibt zurück:
- The response from the server.
- Löst aus:
URISyntaxExceptionIOExceptionInterruptedException
-
getUrl
-
getMethod
-
withMethod
Sets the method of the request.- Parameter:
method- The method to use.- Gibt zurück:
- The HttpRequest.
-
getBody
-
withBody
Sets the body of the request.- Parameter:
body- The body of the request.- Gibt zurück:
- The HttpRequest.
-
getHeaders
-
withHeaders
Sets the headers of the request.- Parameter:
headers- The headers of the request.- Gibt zurück:
- The HttpRequest.
-
withHeader
Adds a header to the request.- Parameter:
key- The key of the header.value- The value of the header.- Gibt zurück:
- The HttpRequest.
-