Examples of addHeader()


Examples of org.scribe.model.ProxyOAuthRequest.addHeader()

        final long t0 = System.currentTimeMillis();
        final ProxyOAuthRequest request = createProxyRequest(dataUrl);
        this.service.signRequest(accessToken, request);
        // Let the client to decide if the token should be in header
        if (this.isTokenAsHeader()) {
            request.addHeader("Authorization", "Bearer " + accessToken.getToken());
        }
        final Response response = request.send();
        final int code = response.getCode();
        final String body = response.getBody();
        final long t1 = System.currentTimeMillis();
View Full Code Here

Examples of org.springframework.mock.web.MockHttpServletRequest.addHeader()

    Assert.assertEquals(response.getContentLength(), 59);

    File file = new File(testDoc.toURI());
    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    request.addHeader("Range", "bytes=5-12");
    streamDownloader.download(request, response, testDoc, null);
    Assert.assertEquals(response.getStatus(), 206);
    Assert.assertEquals(response.getHeader("Content-Range"), "bytes 5-12/" + file.length());
    String content = response.getContentAsString();
    Assert.assertEquals(content, "document");
View Full Code Here

Examples of org.springframework.mock.web.MockHttpServletResponse.addHeader()

  private static final String RESPONSE_CONTENT = "<foo><bar>111</bar><bar>true</bar></foo>";

  private StubMvcResult getStubMvcResult() throws Exception {
    MockHttpServletResponse response = new MockHttpServletResponse();
    response.addHeader("Content-Type", "application/json");
    response.getWriter().print(new String(RESPONSE_CONTENT.getBytes("ISO-8859-1")));
    return new StubMvcResult(null, null, null, null, null, null, response);
  }

}
View Full Code Here

Examples of org.springframework.mock.web.test.MockHttpServletRequest.addHeader()

  @Test
  public void headerPresent() {
    HeadersRequestCondition condition = new HeadersRequestCondition("accept");

    MockHttpServletRequest request = new MockHttpServletRequest();
    request.addHeader("Accept", "");

    assertNotNull(condition.getMatchingCondition(request));
  }

  @Test
View Full Code Here

Examples of org.springframework.shell.support.table.Table.addHeader()

  private static Table createTable(String... headers) {
    Table table = new Table();
    if (headers != null) {
      int column = 1;
      for (String header : headers) {
        table.addHeader(column++, new TableHeader(header));
      }
    }
    return table;
  }
View Full Code Here

Examples of org.springframework.ws.transport.TransportOutputStream.addHeader()

                    String charsetEncoding = axiomMessage.getCharsetEncoding();
                    contentType += "; charset=" + charsetEncoding;
                }
                SoapVersion version = getVersion();
                if (SoapVersion.SOAP_11 == version) {
                    transportOutputStream.addHeader(TransportConstants.HEADER_SOAP_ACTION, soapAction);
                    transportOutputStream.addHeader(TransportConstants.HEADER_ACCEPT, version.getContentType());
                }
                else if (SoapVersion.SOAP_12 == version) {
                    contentType += "; action=" + soapAction;
                    transportOutputStream.addHeader(TransportConstants.HEADER_ACCEPT, version.getContentType());
View Full Code Here

Examples of org.springframework.xd.shell.util.Table.addHeader()

  public Table constructRichGaugeDisplay(double value, double alpha, double average, double max, double min,
      long count) {
    Table t = new Table();
    NumberFormat pattern = new DecimalFormat();
    t.addHeader(1, new TableHeader("Name")).addHeader(2, new TableHeader(getName()));
    t.newRow().addValue(1, "value").addValue(2, pattern.format(value));
    t.newRow().addValue(1, "alpha").addValue(2, pattern.format(alpha));
    t.newRow().addValue(1, "average").addValue(2, pattern.format(average));
    t.newRow().addValue(1, "max").addValue(2, pattern.format(max));
    t.newRow().addValue(1, "min").addValue(2, pattern.format(min));
View Full Code Here

Examples of org.springframework.yarn.support.console.Table.addHeader()

   * @param applications the applications
   * @return the application report table
   */
  private static Table getApplicationReportTable(List<ApplicationReport> applications) {
    Table table = new Table();
    table.addHeader(1, new TableHeader("Id"))
        .addHeader(2, new TableHeader("User"))
        .addHeader(3, new TableHeader("Name"))
        .addHeader(4, new TableHeader("Queue"))
        .addHeader(5, new TableHeader("StartTime"))
        .addHeader(6, new TableHeader("FinishTime"))
View Full Code Here

Examples of org.structr.rest.RestMethodResult.addHeader()

      newNode = createNode(propertySet);

      final RestMethodResult result = new RestMethodResult(HttpServletResponse.SC_CREATED);
      if (newNode != null) {

        result.addHeader("Location", buildLocationHeader(newNode));
        result.addContent(newNode);
      }

      result.serializeAsPrimitiveArray(true);
     
View Full Code Here

Examples of org.switchyard.component.http.composer.HttpRequestBindingData.addHeader()

                httpRequest.setBodyFromStream(request.getInputStream());
                for (Enumeration<String> headerNames = request.getHeaderNames(); headerNames.hasMoreElements();) {
                    String name = headerNames.nextElement();
                    for (Enumeration<String> values = request.getHeaders(name); values.hasMoreElements();) {
                        String value = values.nextElement();
                        httpRequest.addHeader(name, value);
                    }
                }
                httpRequest.setRequestInfo(getRequestInfo(request));
            } catch (IOException e) {
                response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
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.