Package org.gcube.common.gxrest.request
Class GXHTTPStreamRequest
- java.lang.Object
-
- org.gcube.common.gxrest.request.GXHTTPStreamRequest
-
- All Implemented Interfaces:
org.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>
public class GXHTTPStreamRequest extends Object implements org.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>
A context-aware request to a web application. It supports sending streams 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()GXHTTPStreamRequestfrom(String agent)GXInboundResponseget()GXInboundResponsehead()GXHTTPStreamRequestheader(String name, String value)static GXHTTPStreamRequestnewRequest(String address)Creates a new request.GXInboundResponseoptions()GXInboundResponsepatch()GXHTTPStreamRequestpath(String path)GXInboundResponsepost()GXInboundResponsepost(InputStream body)GXInboundResponseput()GXInboundResponseput(InputStream body)GXHTTPStreamRequestqueryParams(Map<String,String> queryParams)GXInboundResponsetrace()
-
-
-
Method Detail
-
newRequest
public static GXHTTPStreamRequest newRequest(String address)
Creates a new request.- Parameters:
address- the address of the web app to call- Returns:
- the request
-
put
public GXInboundResponse put(InputStream body) throws Exception
- Specified by:
putin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
post
public GXInboundResponse post(InputStream body) throws Exception
- Specified by:
postin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
put
public GXInboundResponse put() throws Exception
- Specified by:
putin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
delete
public GXInboundResponse delete() throws Exception
- Specified by:
deletein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
head
public GXInboundResponse head() throws Exception
- Specified by:
headin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
get
public GXInboundResponse get() throws Exception
- Specified by:
getin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
post
public GXInboundResponse post() throws Exception
- Specified by:
postin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
trace
public GXInboundResponse trace() throws Exception
- Specified by:
tracein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
patch
public GXInboundResponse patch() throws Exception
- Specified by:
patchin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
options
public GXInboundResponse options() throws Exception
- Specified by:
optionsin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
connect
public GXInboundResponse connect() throws Exception
- Specified by:
connectin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse>- Throws:
Exception
-
from
public GXHTTPStreamRequest from(String agent)
- Parameters:
string-- Returns:
- the request
-
clear
public void clear()
Clear up the request.
-
path
public GXHTTPStreamRequest path(String path) throws UnsupportedEncodingException
- Parameters:
path-- Returns:
- the request
- Throws:
UnsupportedEncodingException
-
header
public GXHTTPStreamRequest header(String name, String value)
- Parameters:
name-value-- Returns:
- the request
-
queryParams
public GXHTTPStreamRequest queryParams(Map<String,String> queryParams) throws UnsupportedEncodingException
- Parameters:
queryParams-- Returns:
- the request
- Throws:
UnsupportedEncodingException
-
-