Package io.nitric.faas
Class HttpResponseContext
- java.lang.Object
-
- io.nitric.faas.AbstractResponseContext
-
- io.nitric.faas.HttpResponseContext
-
public class HttpResponseContext extends AbstractResponseContext
Provides contextual response metadata for triggers raised by HTTP Requests.
- See Also:
HttpTriggerContext
-
-
Constructor Summary
Constructors Constructor Description HttpResponseContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpResponseContext
addHeader(String key, String value)
Map<String,String>
getHeaders()
int
getStatus()
HttpResponseContext
setHeaders(Map<String,String> headers)
HttpResponseContext
setStatus(int status)
String
toString()
-
Methods inherited from class io.nitric.faas.AbstractResponseContext
asHttp, asTopic, isHttp, isTopic
-
-
-
-
Method Detail
-
getStatus
public int getStatus()
- Returns:
- The HTTP Response status for this context
-
setStatus
public HttpResponseContext setStatus(int status)
- Parameters:
status
- - The HTTP status to set for this context- Returns:
- The instance of the context for chaining
-
addHeader
public HttpResponseContext addHeader(String key, String value)
- Parameters:
key
- The key of the header to addvalue
- The value of the header to add- Returns:
- The instance of the context for chaining
-
setHeaders
public HttpResponseContext setHeaders(Map<String,String> headers)
- Parameters:
headers
- The header map to set- Returns:
- The instance of the context for chaining
-
-