public class RequestLine extends Object
Modifier and Type | Field and Description |
---|---|
Method |
method |
String |
path |
String |
queryString |
String |
version |
Constructor and Description |
---|
RequestLine() |
Modifier and Type | Method and Description |
---|---|
String |
getInitPath() |
Method |
getMethod() |
String |
getPath()
譬如http://www.163.com/user/get?value=tan&id=789,那些此值就是/user/get
|
String |
getPathAndQuery()
/user/get?value=999
|
String |
getProtocol() |
String |
getQueryString()
譬如http://www.163.com/user/get?value=tan&id=789,那些此值就是name=tan&id=789
|
String |
getVersion() |
void |
setInitPath(String initPath) |
void |
setMethod(Method method) |
void |
setPath(String path)
譬如http://www.163.com/user/get?value=tan&id=789,那些此值就是/user/get
|
void |
setProtocol(String protocol) |
void |
setQueryString(String queryString)
譬如http://www.163.com/user/get?value=tan&id=789,那些此值就是name=tan&id=789
|
void |
setVersion(String version) |
String |
toString() |
String |
toUrlEncodedString(String charset)
用来编码用的
"GET /json?tan=谭耀武 HTTP/1.1" -->"GET /json?tan=%E8%B0%AD%E8%80%80%E6%AD%A6 HTTP/1.1"
|
public Method method
public String path
public String queryString
public String version
public Method getMethod()
public String getPath()
public String getPathAndQuery()
public String getQueryString()
public String getVersion()
public void setMethod(Method method)
method
- the method to setpublic void setPath(String path)
path
- the path to setpublic void setQueryString(String queryString)
queryString
- the queryString to setpublic void setVersion(String version)
version
- the version to setpublic String getProtocol()
public void setProtocol(String protocol)
protocol
- the protocol to setpublic String getInitPath()
public void setInitPath(String initPath)
Copyright © 2018. All rights reserved.