Examples of addHeader()


Examples of org.apache.http.message.HeaderGroup.addHeader()

        assertEquals(0, headergroup.getAllHeaders().length);
    }
   
    public void testClear() {
        HeaderGroup headergroup = new HeaderGroup();
        headergroup.addHeader(new BasicHeader("name", "value"));
        assertEquals(1, headergroup.getAllHeaders().length);
        headergroup.clear();
        assertEquals(0, headergroup.getAllHeaders().length);
    }
   
View Full Code Here

Examples of org.apache.http.message.HttpPost.addHeader()

            public HttpRequest submitRequest(final HttpContext context) {
                int i = ((Integer) context.getAttribute("REQ-COUNT")).intValue();
                HttpPost post = null;
                if (i < reqNo) {
                    post = new HttpPost("/");
                    post.addHeader("Secret", Integer.toString(i));
                    ByteArrayEntity outgoing = new ByteArrayEntity(
                            EncodingUtils.getAsciiBytes("No content"));
                    post.setEntity(outgoing);
                   
                    context.setAttribute("REQ-COUNT", new Integer(i + 1));
View Full Code Here

Examples of org.apache.http.mockup.HttpMessageMockup.addHeader()

        ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
        HttpMessage message = new HttpMessageMockup();
       
        // lenient mode
        message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
        message.addHeader("Content-Type", "unknown");
        message.addHeader("Transfer-Encoding", "identity, chunked");
        message.addHeader("Content-Length", "plain wrong");
        assertEquals(ContentLengthStrategy.CHUNKED, lenStrategy.determineLength(message));

        // strict mode
View Full Code Here

Examples of org.apache.jmeter.samplers.jdbc.Data.addHeader()

    int numColumns = meta.getColumnCount();
    String[] dbCols=new String[numColumns];
    for(int count = 1;count<=numColumns;count++)
    {
       dbCols[count-1]=meta.getColumnName(count);
      data.addHeader(dbCols[count-1]);
    }
    while(rs.next())
    {
      data.next();
      for(int count = 0;count<numColumns;count++)
View Full Code Here

Examples of org.apache.jorphan.collections.Data.addHeader()

        int numColumns = meta.getColumnCount();
        String[] dbCols = new String[numColumns];
        for (int i = 0; i < numColumns; i++)
        {
            dbCols[i] = meta.getColumnName(i + 1);
            data.addHeader(dbCols[i]);
        }
       
        while (rs.next())
        {
            data.next();
View Full Code Here

Examples of org.apache.servicemix.soap.marshalers.SoapMessage.addHeader()

                Object value = headers.get(qname);
                if (isWSANamespace(qname.getNamespaceURI())) {
                    if (WSAddressingConstants.EL_MESSAGE_ID.equals(qname.getLocalPart())) {
                        QName name = new QName(qname.getNamespaceURI(), WSAddressingConstants.EL_MESSAGE_ID, qname.getPrefix() != null ? qname.getPrefix() : WSAddressingConstants.WSA_PREFIX);
                        DocumentFragment df = createHeader(name, idGenerator.generateSanitizedId());
                        out.addHeader(name, df);
                        name = new QName(qname.getNamespaceURI(), WSAddressingConstants.EL_RELATES_TO, qname.getPrefix() != null ? qname.getPrefix() : WSAddressingConstants.WSA_PREFIX);
                        df = createHeader(name, getHeaderText(value));
                        out.addHeader(name, df);
                    }
                }
View Full Code Here

Examples of org.apache.shale.test.mock.MockHttpServletRequest.addHeader()

        servletContext
                .addInitParameter("initParameter1", "initParameterValue1");
        MockHttpSession session = new MockHttpSession(servletContext);
        MockHttpServletRequest request = new MockHttpServletRequest(session);
        MockHttpServletResponse response = new MockHttpServletResponse();
        request.addHeader("Content-Type", "text/html");
        request.addParameter("myParam", "value1");
        request.addParameter("myParam", "value2");

        context = new ServletTilesRequestContext(servletContext, request,
                response);
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpRequest.addHeader()

      paramLocation = OAuthParamLocation.AUTH_HEADER;
    }

    switch (paramLocation) {
      case AUTH_HEADER:
        result.addHeader("Authorization", getAuthorizationHeader(oauthParams));
        break;

      case POST_BODY:
        String contentType = result.getHeader("Content-Type");
        if (!OAuth.isFormEncoded(contentType)) {
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpResponseBuilder.addHeader()

   *
   *    { "user_id": "12345678" }
   */
  private HttpResponseBuilder formatAccessTokenData() {
    HttpResponseBuilder builder = new HttpResponseBuilder();
    builder.addHeader("Content-Type", "application/json; charset=utf-8");
    builder.setHttpStatusCode(HttpResponse.SC_OK);
    // no need to cache this, these requests should be fairly rare, and the results should be
    // cached in gadget.
    builder.setStrictNoCache();
    JSONObject json = new JSONObject(accessTokenData);
View Full Code Here

Examples of org.apache.tapestry5.internal.services.ResponseImpl.addHeader()

       
        replay();
   
        for (String value : HEADER_VALUES)
        {
            response.addHeader(HEADER_NAME, value);
        }
       
        verify();
       
    }
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.