On Android, if you use the bundled Apache Httpclient library, you can create your own HTTP method by extending the HttpRequestBase
. In fact, the classes for all standard HTTP methods ( HttpGet
, HttpPost
, etc.) in this library are distributed from the same class.
If your SEARCH
method is very "similar" to any of the existing methods, you can directly extend this class. For example, to illustrate, suppose it is very close to the GET
method. You can then create an HttpSearch
class that extends HttpGet
, and then customizes the implementation by overriding the appropriate methods.
After you finish the implementation of HttpSearch
using it, you use the standard HttpGet
class:
HttpClient client = new HttpClient; //... //... HttpSearch search = new HttpSearch; //... client.execute(search);
source share