Package com.mendix.http
Interface IHttpRequest
public interface IHttpRequest
Represents an HTTP request message to be send to a server.
-
Method Summary
Modifier and TypeMethodDescriptionReturns all the headers of this message.Returns a content stream of the entity.Returns the request HTTP Method.getUri()
Returns the request URI.void
setContent
(InputStream newContent, long length) Overwrites the content steam in the entity.void
setHeaders
(HttpHeader[] headers) Overwrites all the headers in the message.
-
Method Details
-
getUri
String getUri()Returns the request URI.- Returns:
- the request URI.
-
getMethod
String getMethod()Returns the request HTTP Method.- Returns:
- the request HTTP Method.
-
getAllHeaders
HttpHeader[] getAllHeaders()Returns all the headers of this message.- Returns:
- all the headers of this message
-
setHeaders
Overwrites all the headers in the message.- Parameters:
headers
- the array of headers to set.
-
getContent
Optional<InputStream> getContent()Returns a content stream of the entity.- Returns:
- the content, or empty if not set.
-
setContent
Overwrites the content steam in the entity. When calling this method, make sure that you also set the 'Content-Length' header to the correct value.- Parameters:
newContent
- the new content.length
- the length of the new content or-1
if unknown
-