Examples of HttpMethod


Examples of com.gargoylesoftware.htmlunit.HttpMethod

     * @return the request settings
     */
    public WebRequestSettings getWebRequestSettings(final SubmittableElement submitElement) {
        final HtmlPage htmlPage = (HtmlPage) getPage();
        final List<NameValuePair> parameters = getParameterListForSubmit(submitElement);
        final HttpMethod method;
        final String methodAttribute = getMethodAttribute();
        if ("post".equalsIgnoreCase(methodAttribute)) {
            method = HttpMethod.POST;
        }
        else {
View Full Code Here

Examples of com.github.dandelion.datatables.core.export.HttpMethod

      if (StringUtils.isNotBlank(cssStyle)) {
        conf.setCssStyle(new StringBuilder(cssStyle.trim()));
      }

      if (StringUtils.isNotBlank(method)) {
        HttpMethod httpMethod = null;
        try {
          httpMethod = HttpMethod.valueOf(this.method.toUpperCase().trim());
        } catch (IllegalArgumentException e) {
          StringBuilder sb = new StringBuilder();
          sb.append("'");
View Full Code Here

Examples of com.github.dandelion.datatables.core.export.HttpMethod

    }
   
    if (hasAttribute(element, "method")) {
      String methodStr = element.getAttributeValue(DataTablesDialect.DIALECT_PREFIX + ":method");

      HttpMethod methodEnum = null;
      try {
        methodEnum = HttpMethod.valueOf(methodStr.toUpperCase().trim());
      } catch (IllegalArgumentException e) {
        StringBuilder sb = new StringBuilder();
        sb.append("'");
View Full Code Here

Examples of com.google.api.client.http.HttpMethod

    request.setInterceptor(this);
  }

  public void intercept(HttpRequest request) {
    if (overrideThisMethod(request)) {
      HttpMethod method = request.getMethod();
      request.setMethod(HttpMethod.POST);
      request.getHeaders().set("X-HTTP-Method-Override", method.name());
      // Google servers will fail to process a POST unless the Content-Length header is specified
      if (request.getContent() == null) {
        request.setContent(new EmptyContent());
      }
    }
View Full Code Here

Examples of com.google.appengine.api.urlfetch.HTTPMethod

    fetchService = URLFetchServiceFactory.getURLFetchService();
  }

  public FetchResponse fetch(FetchRequest request) throws FetchException {

    HTTPMethod method;
    switch (request.getMethod()) {
      case POST:
        method = HTTPMethod.POST;
        break;
      case HEAD:
View Full Code Here

Examples of com.google.greaze.definition.HttpMethod

    this.gson = gson;
  }

  public void send(HttpURLConnection conn, WebServiceRequest request) {
    try {
      HttpMethod method = request.getHttpMethod();
      if (SIMULATE_POST_WITH_PUT && method == HttpMethod.PUT) {
        method = HttpMethod.POST;
        setHeader(conn, HttpMethod.SIMULATED_METHOD_HEADER, HttpMethod.PUT.toString(), true);
      }
      if (LogConfig.INFO) logger.info(method + " to " + conn.getURL());
      conn.setRequestMethod(method.toString());
      // Assume conservatively that the response will need to be read.
      // This is done here instead of in the response receiver because this property must be set
      // before sending any data on the connection.
      conn.setDoInput(true);
      setHeader(conn, "Accept", request.getContentType(), true);
View Full Code Here

Examples of com.google.jstestdriver.requesthandlers.HttpMethod

    return Iterators.contains(
        Iterators.forEnumeration(request.getHeaders(PRAGMA)), X_SUPPRESS_STATUS_CODE);
  }

  private HttpMethodBase getMethod(final HttpServletRequest request) throws IOException {
    final HttpMethod method = HttpMethod.valueOf(request.getMethod());
    String uri = request.getRequestURI();
    if (prefix != null && !uri.startsWith(prefix)) {
      // Probably impossible.
      throw new RuntimeException(
          String.format(REQUEST_URI_DOES_NOT_START_WITH_PREFIX, uri, prefix));
    }
    String url = prefix == null ? destination + uri : destination + uri.substring(prefix.length());
    switch (method) {
      case POST:
      case PUT:
        return new GatewayEntityMethod(
            method.name(), url, request.getInputStream());
      default:
        return new GatewayMethod(method.name(), url);
    }
  }
View Full Code Here

Examples of com.gwtplatform.dispatch.rest.shared.HttpMethod

    private Multimap<HttpMethod, RestParameter> decodeParameters(String encodedParameters) {
        Multimap<HttpMethod, RestParameter> parameters = LinkedHashMultimap.create();

        JSONObject json = JSONParser.parseStrict(encodedParameters).isObject();
        for (String method : json.keySet()) {
            HttpMethod httpMethod = HttpMethod.valueOf(method);
            JSONArray jsonParameters = json.get(method).isArray();

            for (int i = 0; i < jsonParameters.size(); ++i) {
                JSONObject jsonParameter = jsonParameters.get(i).isObject();
                String key = jsonParameter.get("key").isString().stringValue();
View Full Code Here

Examples of com.maverick.http.HttpMethod

        return value == null || value.length() == 0;
    }

    private static void runStep(HttpClient client, HttpTestEntryStep step) throws Exception {
        String url = "/" + step.getUrl();
        HttpMethod get = step.isPost() ? new PostMethod(url) : new GetMethod(url);
        for (Map.Entry<String, String> entry : step.getParameters().entrySet()) {
            get.setParameter(entry.getKey(), entry.getValue());
        }

        HttpResponse response = client.execute(get);
        int responseCode = response.getStatus();
        assertEquals("Unexpected Status", step.getExpectedCode(), responseCode);
View Full Code Here

Examples of com.maverick.http.HttpMethod

                try {
                    int port = Integer.parseInt(proxyPort);

                    HttpClient client = new HttpClient(proxyHost, port, isSecure);
                    HttpMethod method = new ConnectMethod(url.getHost(), url.getPort() == -1 ? 443 : url.getPort(), true);

                    PasswordCredentials credentials = new PasswordCredentials();
                    credentials.setUsername(proxyUsername);
                    credentials.setPassword(proxyPassword);
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.