Package com.mendix.http
Interface IHttpRequest
-
public interface IHttpRequestRepresents an HTTP request message to be send to a server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpHeader[]getAllHeaders()Returns all the headers of this message.java.util.Optional<java.io.InputStream>getContent()Returns a content stream of the entity.java.lang.StringgetMethod()Returns the request HTTP Method.java.lang.StringgetUri()Returns the request URI.voidsetContent(java.io.InputStream newContent, long length)Overwrites the content steam in the entity.voidsetHeaders(HttpHeader[] headers)Overwrites all the headers in the message.
-
-
-
Method Detail
-
getUri
java.lang.String getUri()
Returns the request URI.- Returns:
- the request URI
-
getMethod
java.lang.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
void setHeaders(HttpHeader[] headers)
Overwrites all the headers in the message.- Parameters:
headers- the array of headers to set
-
getContent
java.util.Optional<java.io.InputStream> getContent()
Returns a content stream of the entity.- Returns:
- the content, or empty if not set
-
setContent
void setContent(java.io.InputStream newContent, long length)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 contentlength- the length of the new content or-1if unknown
-
-