This commit is contained in:
@@ -633,6 +633,17 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
return header.getShortValue(name, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定的header的short值, 没有返回默认short值
|
||||
*
|
||||
* @param name header名
|
||||
* @param defaultValue 默认short值
|
||||
* @return header值
|
||||
*/
|
||||
public short getShortHeader(String name, int defaultValue) {
|
||||
return header.getShortValue(name, (short)defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定的header的int值, 没有返回默认int值
|
||||
*
|
||||
@@ -762,6 +773,18 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
return params.getShortValue(name, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定的参数short值, 没有返回默认short值
|
||||
*
|
||||
* @param name 参数名
|
||||
* @param defaultValue 默认short值
|
||||
* @return 参数值
|
||||
*/
|
||||
public short getShortParameter(String name, int defaultValue) {
|
||||
parseBody();
|
||||
return params.getShortValue(name, (short)defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定的参数int值, 没有返回默认int值
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user