Package ca.uhn.fhir.rest.client.api
Interface IHttpRequest
-
public interface IHttpRequest
Http Request. Allows addition of headers and execution of the request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddHeader(String theName, String theValue)Add a header to the requestIHttpResponseexecute()Execute the requestMap<String,List<String>>getAllHeaders()StringgetHttpVerbName()Return the HTTP verb (e.g.StringgetRequestBodyFromStream()Return the request body as a string.StringgetUri()Return the request URI, or nullvoidremoveHeaders(String theHeaderName)Remove any headers matching the given name
-
-
-
Method Detail
-
addHeader
void addHeader(String theName, String theValue)
Add a header to the request- Parameters:
theName- the header nametheValue- the header value
-
execute
IHttpResponse execute() throws IOException
Execute the request- Returns:
- the response
- Throws:
IOException
-
getAllHeaders
Map<String,List<String>> getAllHeaders()
- Returns:
- all request headers in lower case. Note that this method returns an immutable Map
-
getRequestBodyFromStream
String getRequestBodyFromStream() throws IOException
Return the request body as a string. If this is not supported by the underlying technology, null is returned- Returns:
- a string representation of the request or null if not supported or empty.
- Throws:
IOException
-
getHttpVerbName
String getHttpVerbName()
Return the HTTP verb (e.g. "GET")
-
removeHeaders
void removeHeaders(String theHeaderName)
Remove any headers matching the given name- Parameters:
theHeaderName- The header name, e.g. "Accept" (must not be null or blank)
-
-