Package wappsto.api.rest.request
Class Request.Builder
- java.lang.Object
-
- wappsto.api.rest.request.Request.Builder
-
- Enclosing class:
- Request
public static class Request.Builder extends java.lang.ObjectHTTP Request Builder class
-
-
Constructor Summary
Constructors Constructor Description Builder(javax.ws.rs.client.WebTarget service)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Request.BuilderatEndPoint(java.lang.String path)Append the given path to the requested URLRequest.BuilderatEndPoint(API path)Append the given path to the requested URLvoiddelete()Send a DELETE request to the given endpointjava.lang.Objectdelete(java.lang.Class<?> T)Send a DELETE request to the given endpointvoiddelete(java.lang.String session)Send a DELETE request to the given endpointjava.lang.Objectdelete(java.lang.String session, java.lang.Class<?> T)Send a DELETE request with a session header to the given endpointvoidget()Send a GET request to the given endpointjava.lang.Objectget(java.lang.Class<?> T)Send a GET request to the given endpointjava.lang.Objectget(java.lang.String session, java.lang.Class<?> T)Send a GET request with a session header to the given endpointvoidpatch(java.lang.String session)Send a PATCH request to the desired endpointjava.lang.Objectpatch(java.lang.String session, java.lang.Class<?> T)Send a PATCh request to the desired enpointvoidpost()Send a POST request to the given endpointjava.lang.Objectpost(java.lang.Class<?> T)Send a POST request to the given endpoint.voidpost(java.lang.String session)Send a POST request to the given endpointjava.lang.Objectpost(java.lang.String session, java.lang.Class<?> T)Send a POST request with a session header to the given endpointRequest.BuilderwithBody(java.lang.Object body)Serialize a POJO into JSON
-
-
-
Method Detail
-
withBody
public Request.Builder withBody(java.lang.Object body)
Serialize a POJO into JSON- Parameters:
body- JSON request body- Returns:
- this
-
atEndPoint
public Request.Builder atEndPoint(java.lang.String path)
Append the given path to the requested URL- Parameters:
path- The relative path to the endpoint- Returns:
- this
-
atEndPoint
public Request.Builder atEndPoint(API path)
Append the given path to the requested URL- Parameters:
path- The relative path to the endpoint- Returns:
- this
-
get
public void get() throws java.lang.ExceptionSend a GET request to the given endpoint- Throws:
java.lang.Exception
-
get
public java.lang.Object get(java.lang.Class<?> T) throws java.lang.ExceptionSend a GET request to the given endpoint- Returns:
- JSON response body
- Throws:
java.lang.Exception
-
get
public java.lang.Object get(java.lang.String session, java.lang.Class<?> T) throws java.lang.ExceptionSend a GET request with a session header to the given endpoint- Parameters:
session-T- Desired return type- Returns:
- JSON response body
- Throws:
java.lang.Exception
-
post
public void post() throws java.lang.ExceptionSend a POST request to the given endpoint- Throws:
java.lang.Exception
-
post
public void post(java.lang.String session) throws java.lang.ExceptionSend a POST request to the given endpoint- Parameters:
session- session header- Throws:
java.lang.Exception
-
post
public java.lang.Object post(java.lang.Class<?> T) throws java.lang.ExceptionSend a POST request to the given endpoint.- Parameters:
T- Desired return type- Returns:
- JSON response body
- Throws:
java.lang.Exception
-
post
public java.lang.Object post(java.lang.String session, java.lang.Class<?> T) throws java.lang.ExceptionSend a POST request with a session header to the given endpoint- Parameters:
session-- Returns:
- JSON response body
- Throws:
java.lang.Exception
-
delete
public void delete() throws java.lang.ExceptionSend a DELETE request to the given endpoint- Throws:
java.lang.Exception
-
delete
public void delete(java.lang.String session) throws java.lang.ExceptionSend a DELETE request to the given endpoint- Parameters:
session- session header- Throws:
java.lang.Exception
-
delete
public java.lang.Object delete(java.lang.Class<?> T) throws java.lang.ExceptionSend a DELETE request to the given endpoint- Parameters:
T- desired return type- Returns:
- JSON response body
- Throws:
java.lang.Exception
-
delete
public java.lang.Object delete(java.lang.String session, java.lang.Class<?> T) throws java.lang.ExceptionSend a DELETE request with a session header to the given endpoint- Parameters:
session-T- desired return type- Returns:
- JSON response body
- Throws:
java.lang.Exception
-
patch
public void patch(java.lang.String session) throws java.lang.ExceptionSend a PATCH request to the desired endpoint- Parameters:
session- session header- Throws:
java.lang.Exception
-
patch
public java.lang.Object patch(java.lang.String session, java.lang.Class<?> T) throws java.lang.ExceptionSend a PATCh request to the desired enpoint- Parameters:
session- session headerT- desired return type- Returns:
- JSON response body
- Throws:
java.lang.Exception
-
-