Package ca.uhn.fhir.rest.client.api
Interface IHttpRequest
- All Known Implementing Classes:
BaseHttpRequest
public interface IHttpRequest
Http Request. Allows addition of headers and execution of the request.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a header to the requestexecute()
Execute the requestReturn the HTTP verb (e.g.Return the request body as a string.getUri()
Return the request URI, or nullWhere was the URL from?void
removeHeaders
(String theHeaderName) Remove any headers matching the given namevoid
Modify the request URI, or nullvoid
setUrlSource
(UrlSourceEnum theUrlSource) Where was the URL from?
-
Method Details
-
addHeader
Add a header to the request- Parameters:
theName
- the header nametheValue
- the header value
-
execute
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
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
-
getUri
Return the request URI, or null- See Also:
-
setUri
Modify the request URI, or null- See Also:
-
getHttpVerbName
Return the HTTP verb (e.g. "GET") -
removeHeaders
Remove any headers matching the given name- Parameters:
theHeaderName
- The header name, e.g. "Accept" (must not be null or blank)
-
getUrlSource
Where was the URL from?- Since:
- 5.0.0
-
setUrlSource
Where was the URL from?- Since:
- 5.0.0
-