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 -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear up the request.connect()delete()Sets the User-Agent for the request.get()head()Adds a header to the request.static GXHTTPStreamRequestnewRequest(String address) Creates a new request.options()patch()patch(InputStream body) Adds a path to the request URL.post()post(InputStream body) purge()put()put(InputStream body) queryParams(Map<String, String> queryParams) Adds query parameters to the request.trace()
-
Field Details
-
logger
protected static final org.slf4j.Logger loggerThe logger.
-
-
Method Details
-
newRequest
Creates a new request.- Parameters:
address- the address of the web app to call- Returns:
- the request
-
put
- Specified by:
putin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
post
- Specified by:
postin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
patch
- Specified by:
patchin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
put
- Specified by:
putin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
delete
- Specified by:
deletein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
purge
- Specified by:
purgein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
head
- Specified by:
headin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
get
- Specified by:
getin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
post
- Specified by:
postin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
trace
- Specified by:
tracein interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
patch
- Specified by:
patchin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
options
- Specified by:
optionsin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
connect
- Specified by:
connectin interfaceorg.gcube.common.gxhttp.reference.GXHTTP<InputStream,GXInboundResponse> - Throws:
Exception
-
from
Sets the User-Agent for the request.- Parameters:
agent- the agent- Returns:
- the request
-
clear
public void clear()Clear up the request. -
path
Adds a path to the request URL.- Parameters:
path- the path to add- Returns:
- the request
- Throws:
UnsupportedEncodingException- if the encoding is not supported
-
header
Adds a header to the request.- Parameters:
name- the name of the headervalue- the value of the header- Returns:
- the request
-
queryParams
public GXHTTPStreamRequest queryParams(Map<String, String> queryParams) throws UnsupportedEncodingExceptionAdds query parameters to the request.- Parameters:
queryParams- the query parameters- Returns:
- the request
- Throws:
UnsupportedEncodingException- if the encoding is not supported
-