Package com.qiniu.storage
Class Api.Request
- java.lang.Object
-
- com.qiniu.storage.Api.Request
-
- Direct Known Subclasses:
ApiUpload.Request
- Enclosing class:
- Api
public static class Api.Request extends java.lang.Objectapi 请求基类
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeaderField(java.lang.String key, java.lang.String value)增加请求头StringMapgetHeader()获取请求头信息java.lang.StringgetHost()获取 请求的 Hostjava.lang.StringgetPath()获取 url 的 path 信息java.lang.StringgetQuery()获取 query 字符串java.net.URLgetUrl()获取 URLjava.lang.StringgetUrlPrefix()获取请求的 urlPrefix, scheme + host eg: https://upload.qiniu.combooleanhasBody()是否有请求体Api.RequestsetStreamBodySinkSize(long streamBodySinkSize)使用 streamBody 时,每次读取 streamBody 的大小,读取后发送 默认:streamBodySinkSize相关:sinkSize
-
-
-
Method Detail
-
getUrlPrefix
public java.lang.String getUrlPrefix()
获取请求的 urlPrefix, scheme + host eg: https://upload.qiniu.com- Returns:
- urlPrefix
-
getHost
public java.lang.String getHost() throws QiniuException获取 请求的 Host- Returns:
- Host
- Throws:
QiniuException- 解析 urlPrefix 时的异常
-
getPath
public java.lang.String getPath() throws QiniuException获取 url 的 path 信息- Returns:
- path 信息
- Throws:
QiniuException- 异常
-
getQuery
public java.lang.String getQuery() throws QiniuException获取 query 字符串- Returns:
- query 字符串
- Throws:
QiniuException- 组装 query 时的异常,一般为缺失必要参数的异常
-
addHeaderField
public void addHeaderField(java.lang.String key, java.lang.String value)增加请求头- Parameters:
key- keyvalue- value
-
getHeader
public StringMap getHeader() throws QiniuException
获取请求头信息- Returns:
- 请求头信息
- Throws:
QiniuException- 异常
-
getUrl
public java.net.URL getUrl() throws QiniuException获取 URL- Returns:
- url
- Throws:
QiniuException- 异常
-
setStreamBodySinkSize
public Api.Request setStreamBodySinkSize(long streamBodySinkSize)
使用 streamBody 时,每次读取 streamBody 的大小,读取后发送 默认:streamBodySinkSize相关:sinkSize- Parameters:
streamBodySinkSize- 每次读取 streamBody 的大小- Returns:
- Request
-
hasBody
public boolean hasBody()
是否有请求体- Returns:
- 是否有请求体
-
-