Package org.gcube.common.gxrest.request
Class GXHTTPStringRequest
- java.lang.Object
-
- org.gcube.common.gxrest.request.GXHTTPStringRequest
-
- All Implemented Interfaces:
org.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>
public class GXHTTPStringRequest extends Object implements org.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>
A context-aware request to a web application. It supports sending strings through Put/Post requests.- Author:
- Manuele Simi (ISTI-CNR), Luca Frosini (ISTI-CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlogger
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear up the request.GXInboundResponseconnect()GXInboundResponsedelete()GXHTTPStringRequestfrom(String agent)GXInboundResponseget()GXInboundResponsehead()GXHTTPStringRequestheader(String name, String value)static GXHTTPStringRequestnewRequest(String address)Creates a new request.GXInboundResponseoptions()GXInboundResponsepatch()GXHTTPStringRequestpath(String path)GXInboundResponsepost()GXInboundResponsepost(String body)GXInboundResponseput()GXInboundResponseput(String body)GXHTTPStringRequestqueryParams(Map<String,String> queryParams)GXInboundResponsetrace()GXHTTPStringRequestwithBody(String body)Sets the body of the request.
-
-
-
Method Detail
-
newRequest
public static GXHTTPStringRequest newRequest(String address)
Creates a new request.- Parameters:
address- the address of the web app to call- Returns:
- the request
-
withBody
public GXHTTPStringRequest withBody(String body)
Sets the body of the request.- Parameters:
body-- Returns:
- the request
-
put
public GXInboundResponse put(String body) throws Exception
- Specified by:
putin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
post
public GXInboundResponse post(String body) throws Exception
- Specified by:
postin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
put
public GXInboundResponse put() throws Exception
- Specified by:
putin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
delete
public GXInboundResponse delete() throws Exception
- Specified by:
deletein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
head
public GXInboundResponse head() throws Exception
- Specified by:
headin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
get
public GXInboundResponse get() throws Exception
- Specified by:
getin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
post
public GXInboundResponse post() throws Exception
- Specified by:
postin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
trace
public GXInboundResponse trace() throws Exception
- Specified by:
tracein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
patch
public GXInboundResponse patch() throws Exception
- Specified by:
patchin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
options
public GXInboundResponse options() throws Exception
- Specified by:
optionsin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
connect
public GXInboundResponse connect() throws Exception
- Specified by:
connectin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<String,GXInboundResponse>- Throws:
Exception
-
from
public GXHTTPStringRequest from(String agent)
- Parameters:
string-- Returns:
- the request
-
clear
public void clear()
Clear up the request.
-
path
public GXHTTPStringRequest path(String path) throws UnsupportedEncodingException
- Parameters:
string-- Returns:
- the request
- Throws:
UnsupportedEncodingException
-
header
public GXHTTPStringRequest header(String name, String value)
- Parameters:
name-value-- Returns:
- the request
-
queryParams
public GXHTTPStringRequest queryParams(Map<String,String> queryParams) throws UnsupportedEncodingException
- Parameters:
queryParams-- Returns:
- the request
- Throws:
UnsupportedEncodingException
-
-