Package br.com.mirabilis.http.exception

Examples of br.com.mirabilis.http.exception.HttpRequestException


      connection.connect();
      int status = connection.getResponseCode();
      if (status == HttpStatus.SC_OK) {
        in = connection.getInputStream();
      } else {
        throw new HttpRequestException(ERROR_HTTP + status);
      }
    } finally {
      connection.disconnect();
    }
    return in;
View Full Code Here


        out.write(bytes);
        out.flush();
        out.close();
        in = connection.getInputStream();
      } else {
        throw new HttpRequestException(ERROR_HTTP + status);
      }

    } finally {
      connection.disconnect();
    }
View Full Code Here

      int status = connection.getResponseCode();
      if (status == HttpStatus.SC_OK) {
        in = connection.getInputStream();
        obj = InputStreamUtil.toJSON(in);
      } else {
        throw new HttpRequestException(ERROR_HTTP + status);
      }
    } finally {
      connection.disconnect();
    }
View Full Code Here

        in = connection.getInputStream();

        listener.onResponseHttp(InputStreamUtil.toJSON(in));

      } else {
        throw new HttpRequestException(ERROR_HTTP + status);
      }

    } finally {
      connection.disconnect();
    }
View Full Code Here

    int status = httpResponse.getStatusLine().getStatusCode();
    if (status == HttpStatus.SC_OK) {
      if (httpEntity != null) {
        data = httpEntity.getContent();
      } else {
        throw new HttpRequestException(ENTITY_NULL);
      }
    } else {
      throw new HttpRequestException(ERROR_HTTP + status);
    }
    return data;
  }
View Full Code Here

    List<NameValuePair> params = getParams(map);
    httpPost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
    HttpResponse response = httpClient.execute(httpPost);
    HttpEntity entity = response.getEntity();
    if (entity == null) {
      throw new HttpRequestException(
          "HttpRequest.post response is equals null!");
    } else {
      data = entity.getContent();
    }
    return data;
View Full Code Here

    if (status == HttpStatus.SC_OK) {
      if (httpEntity != null) {
        in = httpEntity.getContent();
        data = InputStreamUtil.toJSON(in);
      } else {
        throw new HttpRequestException(ENTITY_NULL);
      }
    } else {
      throw new HttpRequestException(ERROR_HTTP + status);
    }
    return data;
  }
View Full Code Here

    if (status == HttpStatus.SC_OK) {
      if (httpEntity != null) {
        data = InputStreamUtil.toXML(httpEntity.getContent());
        EntityUtils.toString(httpEntity);
      } else {
        throw new HttpRequestException(ENTITY_NULL);
      }
    } else {
      throw new HttpRequestException(ERROR_HTTP + status);
    }
    listener.onResponseHttp(data);
  }
View Full Code Here

    if (status == HttpStatus.SC_OK) {
      if (httpEntity != null) {
        data = InputStreamUtil.toJSON(httpEntity.getContent());
        EntityUtils.toString(httpEntity);
      } else {
        throw new HttpRequestException(ENTITY_NULL);
      }
    } else {
      throw new HttpRequestException(ERROR_HTTP + status);
    }
    listener.onResponseHttp(data);
  }
View Full Code Here

    case JAKARTA:
      return new HttpJakarta();

    default:
      throw new HttpRequestException("This type of request not exist");
    }
  }
View Full Code Here

TOP

Related Classes of br.com.mirabilis.http.exception.HttpRequestException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.