public class Response extends Object
| Constructor and Description |
|---|
Response() |
Response(org.ballerinalang.jvm.values.ObjectValue responseObj) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String headerName,
String headerValue)
Adds the specified header to the response.
|
String |
getContentType()
Gets the type of the payload of the response (i.e: the `content-type` header value).
|
String |
getHeader(String headerName)
Returns the value of the specified header.
|
String[] |
getHeaderNames()
Gets all the names of the headers of the request.
|
String[] |
getHeaders(String headerName)
Gets all the header values to which the specified header key maps to.
|
protected org.ballerinalang.jvm.values.ObjectValue |
getResponseObjectValue() |
boolean |
hasHeader(String headerName)
Checks whether the requested header key exists in the header map.
|
void |
removeAllHeaders()
Removes all the headers from the response.
|
void |
removeHeader(String headerName)
Removes the specified header from the response.
|
void |
setContentType(String contentType)
Sets the `content-type` header to the response.
|
void |
setHeader(String headerName,
String headerValue)
Sets the specified header to the response.
|
public Response(org.ballerinalang.jvm.values.ObjectValue responseObj)
public Response()
public boolean hasHeader(String headerName)
headerName - The header name.public String getHeader(String headerName)
headerName - The header name.public void addHeader(String headerName, String headerValue)
headerName - The header name.headerValue - The header value.public String[] getHeaders(String headerName)
headerName - The header name.public void setHeader(String headerName, String headerValue)
headerName - The header name.headerValue - The header value.public void removeHeader(String headerName)
headerName - The header name.public void removeAllHeaders()
public String[] getHeaderNames()
public void setContentType(String contentType)
contentType - Content type value to be set as the `content-type` header.public String getContentType()
protected org.ballerinalang.jvm.values.ObjectValue getResponseObjectValue()
Copyright © 2020 WSO2. All rights reserved.