Examples of HttpMethod


Examples of org.apache.commons.httpclient.HttpMethod

    postParams.add(new NameValuePair(SlingPostConstants.RP_CHECKIN, "true"));
    postParams.add(new NameValuePair(SlingPostConstants.RP_REPLACE_PROPERTIES, "true"));
    postParams.add(new NameValuePair(SlingPostConstants.RP_AUTO_CHECKOUT, "true"));
    postParams.add(new NameValuePair(SlingPostConstants.RP_CONTENT, "{ \"abc\": \"def2\" }"));
    postParams.add(new NameValuePair(":http-equiv-accept", "application/json,*/*;q=0.9"));
        HttpMethod post = assertPostStatus(importedNodeUrl, HttpServletResponse.SC_CREATED, postParams, "Expected 201 status");
       
        String responseBodyAsString = post.getResponseBodyAsString();
    JSONObject responseJSON = new JSONObject(responseBodyAsString);
        JSONArray changes = responseJSON.getJSONArray("changes");
        JSONObject checkoutChange = changes.getJSONObject(0);
        assertEquals("checkout", checkoutChange.getString("type"));
   
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethod

import org.apache.sling.commons.testing.integration.HttpTestBase;

public class FiltersTest extends HttpTestBase {

    public void testCounters() throws IOException {
        HttpMethod get = assertHttpStatus(HTTP_BASE_URL + "/index.html", HttpServletResponse.SC_OK);
        final String [] headers = {
            "FILTER_COUNTER_HTTPSERVICE",
            "FILTER_COUNTER_SLING",
            "FILTER_COUNTER_NOPROP"
        };
        for(String header : headers) {
            assertNotNull("Expecting header '" + header + "'", get.getResponseHeader(header));
            assertEquals("Expecting value 1 for header '" + header + "'", "1", get.getResponseHeader(header).getValue());
        }
    }
View Full Code Here

Examples of org.apache.deltacloud.client.HttpMethod

    }

  }

  private void setRequestMethod(DeltaCloudRequest request, HttpURLConnection connection) throws IOException {
    HttpMethod httpMethod = request.getHttpMethod();
    connection.setRequestMethod(httpMethod.name());
    switch (httpMethod) {
    case PUT:
    case POST:
      connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
      connection.setRequestProperty("Content-Length", "0");// String.valueOf(request.getParametersLength()));
View Full Code Here

Examples of org.apache.mina.http.api.HttpMethod

            String[] header = HEADER_VALUE_PATTERN.split(headerFields[i]);
            generalHeaders.put(header[0].toLowerCase(), header[1].trim());
        }

        String[] elements = REQUEST_LINE_PATTERN.split(requestLine);
        HttpMethod method = HttpMethod.valueOf(elements[0]);
        HttpVersion version = HttpVersion.fromString(elements[2]);
        String[] pathFrags = QUERY_STRING_PATTERN.split(elements[1]);
        String requestedPath = pathFrags[0];

        // we put the buffer position where we found the beginning of the HTTP body
View Full Code Here

Examples of org.cruxframework.crux.core.shared.rest.annotation.HttpMethod

  public static String getHttpMethod(Annotation[] annotations, boolean allowNull) throws InvalidRestMethod
  {
    String httpMethod = null;
    for (Annotation annotation : annotations)
    {
      HttpMethod http = annotation.annotationType().getAnnotation(HttpMethod.class);
      if (http != null)
      {
        if (httpMethod != null)
        {
          throw new InvalidRestMethod("Crux REST methods can not be bound to more than one HTTP Method");
        }
        httpMethod = http.value();
      }
    }
    if (!allowNull && httpMethod == null)
    {
      throw new InvalidRestMethod("Crux REST methods must be bound to one HTTP Method");
View Full Code Here

Examples of org.eclipse.jetty.http.HttpMethod

            // else onCompletion will handle it.
        }
    }

    private Timer requestTimer(String method) {
        final HttpMethod m = HttpMethod.fromString(method);
        if (m == null) {
            return otherRequests;
        } else {
            switch (m) {
                case GET:
View Full Code Here

Examples of org.elasticsearch.common.netty.handler.codec.http.HttpMethod

            RestUtils.decodeQueryString(uri, pathEndPos + 1, params);
        }
    }

    @Override public Method method() {
        HttpMethod httpMethod = request.getMethod();
        if (httpMethod == HttpMethod.GET)
            return Method.GET;

        if (httpMethod == HttpMethod.POST)
            return Method.POST;
View Full Code Here

Examples of org.geotools.data.wfs.protocol.http.HttpMethod

            InputStream reader = new ByteArrayInputStream(wfsCapabilitiesRawData);
            final WFS100ProtocolHandler protocolHandler = new WFS100ProtocolHandler(reader,
                    connectionFac);

            try {
                HttpMethod prefferredProtocol = Boolean.TRUE.equals(protocol) ? POST : GET;
                dataStore = new WFS_1_0_0_DataStore(prefferredProtocol, protocolHandler,
                        timeoutMillis, buffer, lenient, wfsStrategy, filterCompliance);
            } catch (SAXException e) {
                logger.warning(e.toString());
                throw new IOException(e.toString());
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpMethod

                throw new NoTypeConversionAvailableException(body, ChannelBuffer.class);
            }
        }

        // update HTTP method accordingly as we know if we have a body or not
        HttpMethod method = NettyHttpHelper.createMethod(message, body != null);
        request.setMethod(method);

        // set the content type in the response.
        String contentType = MessageHelper.getContentType(message);
        if (contentType != null) {
View Full Code Here

Examples of org.mojavemvc.core.HttpMethod

            throws IOException, ServletException {

        HttpServletRequest servletReq = (HttpServletRequest) req;
        HttpServletResponse servletRes = (HttpServletResponse) res;
       
        HttpMethod httpMethod = getHttpMethod(servletReq);
       
        framework.handleRequest(servletReq, servletRes, httpMethod,
                servletReq.getServletPath());
    }
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.