Package com.github.tadukoo.web.rest
Interface Endpoint<ResponseType>
- Type Parameters:
ResponseType- The type of the response
public interface Endpoint<ResponseType>
Endpoint represents a HTTP endpoint that can be accessed and run
- Version:
- Alpha v.0.1
- Author:
- Logan Ferree (Tadukoo)
-
Method Summary
Modifier and TypeMethodDescriptiondefault HttpRequest.BodyPublishergetURL()default ResponseTypeRuns the endpoint and returns the result - this version builds a newclientdefault ResponseTyperunEndpoint(HttpClient client) Runs the endpoint and returns the result - this version takes in aclient
-
Method Details
-
getURL
String getURL()- Returns:
- The URL to use for this endpoint
-
getMethodType
MethodType getMethodType()- Returns:
- The
MethodTypeto use for this endpoint
-
getHeaders
- Returns:
- The headers to use for this endpoint - defaults to an empty map
-
getBodyPublisher
- Returns:
- A
BodyPublisherto use for this endpoint - defaults to no body
-
getBodyHandler
HttpResponse.BodyHandler<ResponseType> getBodyHandler()- Returns:
- A
BodyHandlerto use for this endpoint
-
runEndpoint
Runs the endpoint and returns the result - this version builds a newclient- Returns:
- The response, formatted using the BodyHandler
- Throws:
IOException- If anything goes wrong during sending/receivingInterruptedException- If the operation gets interrupted
-
runEndpoint
Runs the endpoint and returns the result - this version takes in aclient- Parameters:
client- TheHttpClientto be used- Returns:
- The response, formatted using the BodyHandler
- Throws:
IOException- If anything goes wrong during sending/receivingInterruptedException- If the operation gets interrupted
-