Examples of addHeader()


Examples of rabbit.http.HttpHeader.addHeader()

  String etag = header.getHeader ("Etag");
  if (etag != null && !con.isWeak (etag))
      copyHeaderIfExists ("Expires", oldresp, header);
  List<String> ccs = oldresp.getHeaders ("Cache-Control");
  for (int i = 0, s = ccs.size (); i < s; i++)
      header.addHeader ("Cache-Control", ccs.get (i));
  ccs = oldresp.getHeaders ("Vary");
  for (int i = 0, s = ccs.size (); i < s; i++)
      header.addHeader ("Vary", (String)ccs.get (i))
  return header;
    }
View Full Code Here

Examples of railo.runtime.net.http.HttpServletRequestDummy.addHeader()

        root,"localhost",scriptName,queryString,
        ReqRspUtil.getCookies(factory.getConfig(),formerReq),
        HttpUtil.cloneHeaders(formerReq),
        HttpUtil.cloneParameters(formerReq),
        HttpUtil.getAttributesAsStruct(formerReq),null);
        req.addHeader("AMF-Forward", "true");
    HttpServletResponseDummy rsp = new HttpServletResponseDummy(os);

    return  factory.getRailoPageContext(factory.getServlet(), req, rsp, null, false, -1, false);
  }
 
View Full Code Here

Examples of se.unbound.tapestry.breadcrumbs.mocks.RequestMock.addHeader()

    @Test
    public void dispatcherResetsBreadCrumbListIfRefererIsNoValidURI() throws Exception {
        this.breadCrumbList.add(new BreadCrumbInfo("edit.title", new LinkMock("/edit/2"), "Edit"));
        this.addPage("index", new IndexPageMock());
        final RequestMock request = new RequestMock("localhost", 80, "/app", "/index/1");
        request.addHeader("Referer", "http://localhost/app/");
        final Response response = new ResponseMock();
        this.dispatcher.dispatch(request, response);
        assertEquals("list size", 1, this.breadCrumbList.size());
    }
View Full Code Here

Examples of smartrics.rest.client.RestData.addHeader()

    }

  @Test
  public void shouldReturnCorrectTypeGivenApplicationXml() {
    RestData d = new RestResponse();
    d.addHeader("Content-Type", "application/xml");
    assertEquals(ContentType.XML, ContentType.parse(d.getContentType()));
  }
 
  @Test
  public void shouldReturnCorrectTypeGivenApplicationJson() {
View Full Code Here

Examples of smartrics.rest.client.RestRequest.addHeader()

        RestClient c = new RestClientImpl(new HttpClient());
        RestRequest req = new RestRequest();
        req.setBody("name=n&data=d1");
        req.setResource("/resources/");
        req.setMethod(Method.Post);
        req.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
        RestResponse res = c.execute("http://localhost:8765", req);
        System.out.println("=======>\n" + res + "\n<=======");
    }

    public static void postXml(String[] args) {
View Full Code Here

Examples of smartrics.rest.client.RestResponse.addHeader()

        RestResponse response = new RestResponse();
        response.setResource("/resources");
        response.setStatusCode(200);
        response.setStatusText("OK");
        response.setBody(body);
        response.addHeader("Content-Type", contentType.toMime().get(0));
        response.addHeader("Bespoke-Header", "jolly");
        response.addHeader("Bespoke-Header", "good");
        response.addHeader("Content-Length", "7");
        response.setTransactionId(123456789L);
        return response;
View Full Code Here

Examples of waffle.apache.catalina.SimpleHttpRequest.addHeader()

            clientContext.initialize(null, null, WindowsAccountImpl.getCurrentUsername());
            final SimpleHttpRequest request = new SimpleHttpRequest();
            request.setMethod("POST");
            request.setContentLength(0);
            final String clientToken = BaseEncoding.base64().encode(clientContext.getToken());
            request.addHeader("Authorization", securityPackage + " " + clientToken);
            final SimpleHttpResponse response = new SimpleHttpResponse();
            this.authenticator.authenticate(request, response, null);
            Assert.assertTrue(response.getHeader("WWW-Authenticate").startsWith(securityPackage + " "));
            Assert.assertEquals("keep-alive", response.getHeader("Connection"));
            Assert.assertEquals(2, response.getHeaderNames().size());
View Full Code Here

Examples of waffle.mock.http.SimpleHttpRequest.addHeader()

    private static final Logger LOGGER = LoggerFactory.getLogger(WaffleInfoServletTests.class);

    @Test
    public void testGetInfo() throws Exception {
        SimpleHttpRequest request = new SimpleHttpRequest();
        request.addHeader("hello", "waffle");

        SimpleHttpResponse response = new SimpleHttpResponse();

        WaffleInfoServlet servlet = new WaffleInfoServlet();
        servlet.doGet(request, response);
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.