Package com.auth0.net
Interface Request<T>
- Type Parameters:
T
- the type of payload expected in the response after the execution.
- All Known Implementing Classes:
BaseRequest
,EmptyBodyRequest
,FormBodyRequest
,MultipartRequest
,SignUpRequest
,TokenRequest
,VoidRequest
public interface Request<T>
Class that represents an HTTP Request that can be executed.
-
Method Summary
Modifier and TypeMethodDescriptionAdds an HTTP header to the requestaddParameter
(String name, Object value) Adds an body parameter to the requestexecute()
Executes this request synchronously.Executes this request asynchronously.Sets the response's body directly
-
Method Details
-
execute
Executes this request synchronously.- Returns:
- a
Response
containing information about the response. - Throws:
APIException
- if the request was executed but the response wasn't successful.Auth0Exception
- if the request couldn't be created or executed successfully.
-
executeAsync
CompletableFuture<Response<T>> executeAsync()Executes this request asynchronously.- Returns:
- a CompletableFuture representing the specified request.
-
addHeader
Adds an HTTP header to the request- Parameters:
name
- the name of the headervalue
- the value of the header- Returns:
- this same request instance
-
addParameter
Adds an body parameter to the request- Parameters:
name
- the name of the parametervalue
- the value of the parameter- Returns:
- this same request instance
-
setBody
Sets the response's body directly- Parameters:
body
- the value to set as body- Returns:
- this same request instance
-