Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpPost.reset()


            HttpResponse response = this.httpClient.execute(update);

            // Expect 2xx or 3xx response
            int status = response.getStatusLine().getStatusCode();
            update.reset();
            if (status >= 200 && status < 400) {
                // OK
                LOGGER.info("Update succeeded with HTTP Code " + status);
            } else {
                throw new ValidationError("Update failed with HTTP Code " + status);
View Full Code Here


            // Expect a 2xx response with a True result
            status = response.getStatusLine().getStatusCode();
            if (status >= 200 && status < 300) {
                LOGGER.info("Query succeeded with HTTP code " + status);
                boolean askResult = XMLInput.booleanFromXML(response.getEntity().getContent());
                query.reset();
                if (askResult) {
                    LOGGER.info("Test update_dataset_full passed");
                } else {
                    throw new ValidationError("Query returned false when true was expected");
                }
View Full Code Here

                    LOGGER.info("Test update_dataset_full passed");
                } else {
                    throw new ValidationError("Query returned false when true was expected");
                }
            } else {
                query.reset();
                throw new ValidationError("Query failed with HTTP Code " + status);
            }
        } catch (IOException ioEx) {
            throw new ValidationError("IO Error", ioEx);
        }
View Full Code Here

        } catch (final Exception e) {
          LOG.log(Level.WARNING,
              "HTTP roundtrip resulted in exception!", e);
        } finally {
          if (httpPost != null) {
            httpPost.reset();
          }
        }
      }
    });
  }
View Full Code Here

        } catch (final Exception e) {
          LOG.log(Level.WARNING,
              "HTTP roundtrip resulted in exception!", e);
        } finally {
          if (httpPost != null) {
            httpPost.reset();
          }
        }
      }
    });
  }
View Full Code Here

        response = new JSONResponse();
      }
    } catch (JSONRPCException err) {
      response = new JSONResponse(err);
    } finally {
      httpPost.reset();
    }
    return response;
  }
 
  /**
 
View Full Code Here

          response = new JSONResponse();
        }
      } catch (JSONRPCException err) {
        response = new JSONResponse(err);
      } finally {
        httpPost.reset();
      }
      return response;
    } catch (Exception e) {
      throw new JSONRPCException("Failed to send RPC call through HTTP",
          e);
View Full Code Here

        } catch (final Exception e) {
          LOG.log(Level.WARNING,
              "HTTP roundtrip resulted in exception!", e);
        } finally {
          if (httpPost != null) {
            httpPost.reset();
          }
        }
      }
    });
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.