Package com.google.greaze.definition.webservice

Examples of com.google.greaze.definition.webservice.RequestBody


        WebServiceRequestInlined inlinedBody = convertToInlinedBody(request);
        requestBodyContents = bodyToJson(inlinedBody);
      } else {
        addRequestParams(conn, request.getHeaders());
        if (method != HttpMethod.GET && method != HttpMethod.DELETE) {
          RequestBody requestBody = request.getBody();
          requestBodyContents = bodyToJson(requestBody);
        }
      }
      requestBodyContents = stripEnclosingQuotes(requestBodyContents);
      if (GreazeStrings.isNotEmpty(requestBodyContents)) {
View Full Code Here


    RequestSpec requestSpec = callSpec.getRequestSpec();
    HeaderMap.Builder requestHeadersBuilder = new HeaderMap.Builder(requestSpec.getHeadersSpec());
    if (context != null) {
      context.populate(requestHeadersBuilder);
    }
    RequestBody requestBody = new RequestBody.Builder(requestSpec.getBodySpec())
      .build();
    UrlParams urlParams = new UrlParams.Builder(requestSpec.getUrlParamsSpec(), query).build();
    WebServiceRequest request = new WebServiceRequest(
        HttpMethod.GET, requestHeadersBuilder.build(), urlParams, requestBody, inlined);
    WebServiceResponse response = stub.getResponse(callSpec, request, gson);
View Full Code Here

  HeaderMap requestHeaders = new HeaderMap.Builder(spec.getRequestSpec().getHeadersSpec())
      .put(TypedKeys.Request.AUTH_TOKEN, authToken)
      .build();
  UrlParams urlParams = new UrlParams.Builder(spec.getRequestSpec().getUrlParamsSpec())
      .build();
  RequestBody requestBody = new RequestBody.Builder(spec.getRequestSpec().getBodySpec())
      .put(TypedKeys.RequestBody.CART, cart)
      .build();
  WebServiceRequest request = new WebServiceRequest(
      HttpMethod.POST, requestHeaders, urlParams, requestBody, false);
  WebServiceResponse response = wsClient.getResponse(spec, request, gson);
View Full Code Here

    HeaderMapSpec requestHeaderSpec = new HeaderMapSpec.Builder().build();
    HeaderMap requestHeaders = new HeaderMap.Builder(requestHeaderSpec).build();
    RequestBodySpec requestBodySpec = new RequestBodySpec.Builder()
      .setSimpleBody(String.class)
      .build();
    RequestBody requestBody = new RequestBody.Builder(requestBodySpec).build();
    for (HttpMethod method : new HttpMethod[]{HttpMethod.GET, HttpMethod.DELETE}) {
      HttpUrlConnectionMock conn = new HttpUrlConnectionMock();
      sender.send(conn, new WebServiceRequest(method, requestHeaders, null, requestBody, null, false));
      assertNull(conn.getHeaders().get("Content-Type"));
    }
View Full Code Here

    HeaderMapSpec requestHeaderSpec = new HeaderMapSpec.Builder().build();
    HeaderMap requestHeaders = new HeaderMap.Builder(requestHeaderSpec).build();
    RequestBodySpec requestBodySpec = new RequestBodySpec.Builder()
      .setSimpleBody(String.class)
      .build();
    RequestBody requestBody = new RequestBody.Builder(requestBodySpec)
      .setSimpleBody("hello world")
      .build();
    for (HttpMethod method : new HttpMethod[]{HttpMethod.POST, HttpMethod.PUT}) {
      HttpUrlConnectionMock conn = new HttpUrlConnectionMock();
      sender.send(conn, new WebServiceRequest(method, requestHeaders, null, requestBody, null, false));
View Full Code Here

    HeaderMap requestHeaders = new HeaderMap.Builder(requestHeaderSpec)
      .put("X-Name", "bob")
      .put("X-Salary", 10000)
      .build();
    UrlParams urlParams = null;
    RequestBody requestBody = null;
    RequestSpec requestSpec = null;
    WebServiceRequest request = new WebServiceRequest(
        HttpMethod.GET, requestHeaders, urlParams, requestBody, requestSpec, false);
    HttpUrlConnectionMock conn = new HttpUrlConnectionMock();
    sender.send(conn, request);
View Full Code Here

      .build();
    HeaderMap requestHeaders = new HeaderMap.Builder(requestHeaderSpec)
      .put("X-Number", new ComplexNumber(10, 3))
      .build();
    UrlParams urlParams = null;
    RequestBody requestBody = null;
    RequestSpec requestSpec = null;
    WebServiceRequest request = new WebServiceRequest(
        HttpMethod.GET, requestHeaders, urlParams, requestBody, requestSpec, false);
    HttpUrlConnectionMock conn = new HttpUrlConnectionMock();
    sender.send(conn, request);
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.webservice.RequestBody

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.