Java 对于HttpGet方法,getParams()是什么?
这些情人是什么?它们是查询字符串吗?似乎没有简单的方法可以使用org.apache.http.client.methods.HttpGet添加查询字符串。这些参数是http GET请求参数 例如,在URL中,参数username的值为mcjones。根据,可以执行以下操作:Java 对于HttpGet方法,getParams()是什么?,java,apache-httpclient-4.x,Java,Apache Httpclient 4.x,这些情人是什么?它们是查询字符串吗?似乎没有简单的方法可以使用org.apache.http.client.methods.HttpGet添加查询字符串。这些参数是http GET请求参数 例如,在URL中,参数username的值为mcjones。根据,可以执行以下操作: org.apache.http.client.methods.HttpGet; HttpGet method = new HttpGet(url.toExternalForm()); method.getParams()
org.apache.http.client.methods.HttpGet;
HttpGet method = new HttpGet(url.toExternalForm());
method.getParams()
发件人:
getParams
URI uri = new URIBuilder()
.setScheme("http")
.setHost("www.google.com")
.setPath("/search")
.setParameter("q", "httpclient")
.setParameter("btnG", "Google Search")
.setParameter("aq", "f")
.setParameter("oq", "")
.build();
HttpGet httpget = new HttpGet(uri);
System.out.println(httpget.getURI());
公共HttpMethodParams getParams()
请求的完整参数列表可在中找到。问题是关于httpclient 4.x的,您的答案是关于3.x的。
Returns HTTP protocol parameters associated with this method.
Specified by:
getParams in interface HttpMethod
Returns:
HTTP parameters.
Since:
3.0
See Also:
HttpMethodParams