Examples of addHeader()


Examples of org.b3log.latke.urlfetch.HTTPRequest.addHeader()

    public String httpPost(String url, String queryString) throws Exception {
        String ret = null;
        final HTTPRequest request = new HTTPRequest();
        request.setURL(new URL(url));
        request.setRequestMethod(HTTPRequestMethod.POST);
        request.addHeader(new HTTPHeader("Content-Type",
                                         "application/x-www-form-urlencoded"));
        if (queryString != null && !queryString.equals("")) {
            request.setPayload(queryString.getBytes("UTF-8"));
        }
View Full Code Here

Examples of org.b3log.latke.urlfetch.HTTPResponse.addHeader()

        ret.setResponseCode(response.getResponseCode());

        final List<com.google.appengine.api.urlfetch.HTTPHeader> gaeHTTPHeaders = response.getHeaders();
        for (final com.google.appengine.api.urlfetch.HTTPHeader gaeHTTPHeader : gaeHTTPHeaders) {
            final HTTPHeader header = new HTTPHeader(gaeHTTPHeader.getName(), gaeHTTPHeader.getValue());
            ret.addHeader(header);
        }

        return ret;
    }
View Full Code Here

Examples of org.browsermob.proxy.ProxyServer.addHeader()

        ProxyServer proxy = proxyManager.get(port);
        Map<String, String> headers = request.read(Map.class).as(Json.class);
        for (Map.Entry<String, String> entry : headers.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            proxy.addHeader(key, value);
        }
        return Reply.saying().ok();
    }

    @Put
View Full Code Here

Examples of org.codehaus.plexus.mailsender.MailMessage.addHeader()

            return;
        }

        MailMessage message = new MailMessage();

        message.addHeader( "X-Continuum-Build-Host", buildHost );

        message.addHeader( "X-Continuum-Project-Id", Integer.toString( project.getId() ) );

        message.addHeader( "X-Continuum-Project-Name", project.getName() );
View Full Code Here

Examples of org.deftserver.util.HttpRequestHelper.addHeader()

   */
  @Test
  public void testOfConvertsHeaderKeysToLowerCase() {

    HttpRequestHelper helper = new HttpRequestHelper();
    helper.addHeader("TESTKEY", "unimportant");
    HttpRequest request = HttpRequest.of(helper.getRequestAsByteBuffer());

    assertFalse(request.getHeaders().containsKey("TESTKEY"));
    assertTrue(request.getHeaders().containsKey("testkey"));
  }
View Full Code Here

Examples of org.drools.guvnor.client.common.PrettyFormLayout.addHeader()

        Label caption = new Label( constants.PermissionDetails() );
        caption.getElement().getStyle().setFontWeight( FontWeight.BOLD );
        header.add( caption );
        header.add( howToTurnOn() );

        pf.addHeader( images.userPermissionsLarge(),
                      header );

        layout = new VerticalPanel();
        layout.setHeight( "100%" );
        layout.setWidth( "100%" );
View Full Code Here

Examples of org.eclipse.jetty.testing.HttpTester.addHeader()

        request.setMethod(method);
        request.setURI(url);
        request.setVersion("HTTP/1.0");
        BASE64Encoder enc = new sun.misc.BASE64Encoder();
        String userPassword = username + ":" + password;
        request.addHeader("Authorization", "Basic " + enc.encode(userPassword.getBytes()));
        return request;
    }

    protected ConstraintMapping constraintMapping(String method, String url, String... roles) {
        ConstraintMapping constraintMapping = new ConstraintMapping();
View Full Code Here

Examples of org.eclipse.jetty.websocket.common.test.BlockheadClient.addHeader()

        client.setTimeout(1,TimeUnit.SECONDS);

        try
        {
            client.connect();
            client.addHeader("Cookie: fruit=Pear; type=Anjou\r\n");
            client.sendStandardRequest();
            client.expectUpgradeResponse();

            UpgradeRequest req = echoCreator.getLastRequest();
            Assert.assertThat("Last Request",req,notNullValue());
View Full Code Here

Examples of org.elasticsearch.rest.BytesRestResponse.addHeader()

        } else if (authorized(request)) {
            super.internalDispatchRequest(request, channel);
        } else {
          logUnAuthorizedRequest(request);
          BytesRestResponse response = new BytesRestResponse(UNAUTHORIZED, "Authentication Required");
          response.addHeader("WWW-Authenticate", "Basic realm=\"Restricted\"");
          channel.sendResponse(response);
        }
    }

    private boolean healthCheck(final HttpRequest request) {
View Full Code Here

Examples of org.fao.oaipmh.responses.ListIdentifiersResponse.addHeader()

      Header h = buildHeader(context, id, result.prefix);

      if (h != null)
      {
        res.addHeader(h);
        num++;
      }

      pos++;
    }
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.