在我的类DeviceHandler中,我想知道所使用的HTTP请求方法;我不明白我的HttpRequest对象怎么样?
public class DeviceHandler implements HttpRequestHandler {
...
public void handle(HttpRequest request, HttpResponse response,
HttpContext httpContext) throws HttpException,
IOException {
// I want to dispatch the treatment according GET or POST request received from my client
谢谢你们!
安东尼
答案 0 :(得分:2)
这是文档
http://developer.android.com/reference/org/apache/http/HttpRequest.html
使用
RequestLine rl = request.getRequestLine();
检索RequestLine实例,然后可以调用
String m = rl.getMethod();
获取请求方法。