Package com.avoka.tm.http
Class RequestBuilder
java.lang.Object
com.avoka.tm.http.RequestBuilder
Provides a HTTP Request Builder class.
Examples
Please find the Components HTTP Request Builder examples below.
Building Get Request Example
This Groovy example shows how to build GetRequest object
import com.avoka.tm.http.* import com.avoka.tm.vo.* SvcConn svcConn = svcDef.svcConn String path = "https://service.mycorp.com/..." GetRequest get = new RequestBuilder() .setSvcConn(svcConn) .setPath(path) .buildGet()
Building Post Request Example
This Groovy example shows how to build PostRequest object.
import com.avoka.tm.http.* import com.avoka.tm.vo.* SvcConn svcConn = svcDef.svcConn String path = "https://service.mycorp.com/..." PostRequest post = new RequestBuilder() .setSvcConn(svcConn) .setPath(path) .buildPost();
- Since:
- 5.0.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn a new DeleteRequest object from the service connection parameter.buildGet()
Return a new GetRequest object from the service connection parameter.Return a new PatchRequest object from the service connection parameter.Return a new PostRequest object from the service connection parameter.buildPut()
Return a new PutRequest object from the service connection parameter.Set the path to append the to service connection endpoint for the request URL.setSvcConn
(SvcConn svcConn) Set the service connection parameter.
-
Constructor Details
-
RequestBuilder
public RequestBuilder()
-
-
Method Details
-
setPath
Set the path to append the to service connection endpoint for the request URL.- Parameters:
path
- the to append the to service connection endpoint for the request URL- Returns:
- the request builder
-
setSvcConn
Set the service connection parameter.- Parameters:
svcConn
- the service connection parameter- Returns:
- the request builder
-
buildDelete
Return a new DeleteRequest object from the service connection parameter.- Returns:
- a new DeleteRequest object from the service connection parameter
-
buildGet
Return a new GetRequest object from the service connection parameter.- Returns:
- a new GetRequest object from the service connection parameter
-
buildPatch
Return a new PatchRequest object from the service connection parameter.- Returns:
- a new PatchRequest object from the service connection parameter
-
buildPost
Return a new PostRequest object from the service connection parameter.- Returns:
- a new PostRequest object from the service connection parameter
-
buildPut
Return a new PutRequest object from the service connection parameter.- Returns:
- a new PutRequest object from the service connection parameter
-