Android Open Source - httpbreeze Http Request Executor Template






From Project

Back to project page httpbreeze.

License

The source code is released under:

GNU General Public License

If you think the Android project httpbreeze listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.http.breeze.rest;
/*from w  w w  .j a v  a2s .c o m*/
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;

public abstract class HttpRequestExecutorTemplate implements HttpRequestExecutor {
  protected HttpRequest httpRequest;

  protected HttpRequestExecutorTemplate(HttpRequest httpRequest) {
    super();
    this.httpRequest = httpRequest;
  }
  
  public final String makeRequest() throws MalformedURLException, UnsupportedEncodingException,IOException{
    String response = null;
    switch(this.httpRequest.getMethod()){
    case GET:
      response = executeAsGetRequest();
      break;
    case POST:
      response = executeAsPostRequest();
      break;
    }
    
    return response;
  }

}




Java Source Code List

com.http.breeze.rest.HttpMethod.java
com.http.breeze.rest.HttpRequestExecutorTemplate.java
com.http.breeze.rest.HttpRequestExecutorType.java
com.http.breeze.rest.HttpRequestExecutor.java
com.http.breeze.rest.HttpRequest.java
com.http.breeze.rest.HttpResponseConverter.java
com.http.breeze.rest.JsonResponseConverter.java
com.http.breeze.rest.RawHttpRequestExecutor.java