Examples of HttpHeaders


Examples of alexoft.utils.HTTPHeaders

          n=from_client.read(buff);
          if(n==-1) break;
          headerString.append(String.valueOf(buff, 0, n));
          if(n!=4096) break;
        }
        HTTPHeaders h = HTTPHeaders.read(headerString.toString());
        if(h.url.equals("/")){
          String r = "HTTP/1.0 307 Temporary Redirect\r\nLocation: " + "http://127.0.0.1:8123/game/index.php?page=overview\r\n\r\n";
          client.getOutputStream().write(r.getBytes(), 0, r.getBytes().length);
        }else{
          Network.copyHTTPGet("http://" + this.parent.baseURL + ".ogame.fr" + h.url, client.getOutputStream(), this.parent.baseURL);
View Full Code Here

Examples of bixo.datum.HttpHeaders

        } catch (InterruptedException e) {
            // Break out of our delay, but preserve interrupt state.
            Thread.currentThread().interrupt();
        }

        HttpHeaders headers = new HttpHeaders();
        headers.add("x-responserate", "" + bytesPerSecond);
        FetchedDatum result = new FetchedDatum(url, url, System.currentTimeMillis(), headers, new ContentBytes(new byte[contentSize]), "text/html", bytesPerSecond);
        result.setPayload(payload);
        return result;
    }
View Full Code Here

Examples of com.github.tomakehurst.wiremock.http.HttpHeaders

    @Override
    public ResponseDefinition execute(Admin admin, Request request) {
        RequestPattern requestPattern = buildRequestPatternFrom(request.getBodyAsString());
        FindRequestsResult result = admin.findRequestsMatching(requestPattern);
        ResponseDefinition response = new ResponseDefinition(HTTP_OK, Json.write(result));
        response.setHeaders(new HttpHeaders(httpHeader("Content-Type", "application/json")));
        return response;
    }
View Full Code Here

Examples of com.google.api.client.http.HttpHeaders

  public HttpManager() {
    requestFactory = APACHE_HTTP_TRANSPORT.createRequestFactory(new HttpRequestInitializer() {
      @Override
      public void initialize(HttpRequest hr) throws IOException {
        hr.setParser(new XmlObjectParser(DefaultConfigs.DOUBAN_XML_NAMESPACE));
        HttpHeaders header = new HttpHeaders();
        header.setUserAgent("Dongxuexidu - Douban Java SDK");
        hr.setHeaders(header);
        hr.setNumberOfRetries(3);
      }
    });
  }
View Full Code Here

Examples of com.google.api.client.http.HttpHeaders

    try {
      if (needToken) {
        if (!hasAccessTokenBeenSet()) {
          throw ErrorHandler.accessTokenNotSet();
        }
        HttpHeaders headers = method.getHeaders();
        headers.setAuthorization("Bearer " + this.accessToken);
      }
      HttpResponse res = method.execute();
      return res;
    } catch (HttpResponseException ex) {
      throw ErrorHandler.handleHttpResponseError(ex);
View Full Code Here

Examples of com.ramforth.webserver.http.HttpHeaders

    private final IHttpHeaderFactory httpHeaderFactory = new HttpHeaderFactory();

    @Override
    public IHttpHeaders parse(InputStream is) {
        IHttpHeaders httpHeaders = new HttpHeaders();

        IHttpHeader header;
        while ((header = parseHeader(is)) != null) {
            httpHeaders.addHeader(header);
        }

        return httpHeaders;
    }
View Full Code Here

Examples of com.volantis.mcs.http.HttpHeaders

        request.setHeaders(headers);
        context.setDevicePolicyValue(DevicePolicyConstants.DEFAULT_OUTPUT_CHARSET,
                                     deviceCharset);
        context.setDevicePolicyValue(DevicePolicyConstants.FORCED_OUTPUT_CHARSET,
                                     forcedCharset);
        HttpHeaders rHeaders = HttpServletFactory.
                getDefaultInstance().getHTTPHeaders(request);

        try {
            // Create simple accessor for use in the tests
            TestPolicyDescriptorAccessor accessor =
View Full Code Here

Examples of io.netty.handler.codec.http.HttpHeaders

    private void writeResponse(ChannelHandlerContext ctx, HttpRequest request, ByteBuf buf, CharSequence contentType, CharSequence contentLength) {
  // Decide whether to close the connection or not.
  boolean keepAlive = HttpHeaders.isKeepAlive(request);
  // Build the response object.
  FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, buf, false);
  HttpHeaders headers = response.headers();
  headers.set(CONTENT_TYPE_ENTITY, contentType);
  headers.set(SERVER_ENTITY, SERVER_NAME);
  headers.set(DATE_ENTITY, date);
  headers.set(CONTENT_LENGTH_ENTITY, contentLength);

  // Close the non-keep-alive connection after the write operation is
  // done.
  if (!keepAlive) {
      ctx.write(response).addListener(ChannelFutureListener.CLOSE);
View Full Code Here

Examples of javax.ws.rs.core.HttpHeaders

         ResteasyProviderFactory defaultInstance = ResteasyProviderFactory.getInstance();
         if (defaultInstance instanceof ThreadLocalResteasyProviderFactory)
         {
            ThreadLocalResteasyProviderFactory.push(providerFactory);
         }
         HttpHeaders headers = null;
         UriInfoImpl uriInfo = null;
         try
         {
            headers = ServletUtil.extractHttpHeaders(request);
            uriInfo = ServletUtil.extractUriInfo(request, servletMappingPrefix);
View Full Code Here

Examples of javax.ws.rs.core.HttpHeaders

            createHeader("COMPLEX_HEADER""b=c; param=c, a=b;param=b");
        EasyMock.expectLastCall().andReturn(headers);
        m.getContextualProperty("org.apache.cxf.http.header.split");
        EasyMock.expectLastCall().andReturn("true");
        control.replay();
        HttpHeaders h = new HttpHeadersImpl(m);
        List<String> values = h.getRequestHeader("COMPLEX_HEADER");
        assertNotNull(values);
        assertEquals(2, values.size());
        assertEquals("b=c; param=c", values.get(0));
        assertEquals("a=b;param=b", values.get(1));
    }
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.