public class Request extends Object
| Constructor and Description |
|---|
Request(org.ballerinalang.jvm.values.ObjectValue requestObj) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String headerName,
String headerValue)
Adds the specified header to the request.
|
boolean |
expects100Continue()
Checks whether the client expects a `100-continue` response.
|
String |
getContentType()
Gets the type of the payload of the request (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.
|
org.ballerinalang.jvm.values.api.BMap<String,Object> |
getMatrixParams(String path)
Gets the matrix parameters of the request.
|
org.ballerinalang.jvm.values.api.BMap<String,Object> |
getQueryParams()
Gets the query parameters of the request as a ballerina map.
|
String |
getQueryParamValue(String key)
Gets the query param value associated with the given key.
|
String[] |
getQueryParamValues(String key)
Gets all the query param values associated with the given key.
|
boolean |
hasHeader(String headerName)
Checks whether the requested header key exists in the header map.
|
void |
removeAllHeaders()
Removes all the headers from the request.
|
void |
removeHeader(String headerName)
Removes the specified header from the request.
|
void |
setContentType(String contentType)
Sets the `content-type` header to the request.
|
void |
setHeader(String headerName,
String headerValue)
Sets the specified header to the request.
|
public org.ballerinalang.jvm.values.api.BMap<String,Object> getQueryParams()
BMap Ballerina map value object containing query parameters.public String getQueryParamValue(String key)
key - Represents the query param key.public String[] getQueryParamValues(String key)
key - Represents the query param key.public org.ballerinalang.jvm.values.api.BMap<String,Object> getMatrixParams(String path)
path - Path to the location of matrix parameters.MapValue of matrix parameters which can be found for the given path.public boolean hasHeader(String headerName)
headerName - The header name.public String getHeader(String headerName)
headerName - The header name.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 addHeader(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 boolean expects100Continue()
public void setContentType(String contentType)
contentType - Content type value to be set as the `content-type` header.public String getContentType()
Copyright © 2020 WSO2. All rights reserved.