Examples of HTTPHeader


Examples of com.facebook.presto.jdbc.internal.jetty.http.HttpHeader

        ResponseNotifier notifier = getHttpDestination().getResponseNotifier();
        boolean process = notifier.notifyHeader(exchange.getConversation().getResponseListeners(), response, field);
        if (process)
        {
            response.getHeaders().add(field);
            HttpHeader fieldHeader = field.getHeader();
            if (fieldHeader != null)
            {
                switch (fieldHeader)
                {
                    case SET_COOKIE:
View Full Code Here

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

    private static Predicate<Map.Entry<String, ValuePattern>> matchHeadersIn(final Request request) {
        return new Predicate<Map.Entry<String, ValuePattern>>() {
            public boolean apply(Map.Entry<String, ValuePattern> headerPattern) {
                ValuePattern headerValuePattern = headerPattern.getValue();
                String key = headerPattern.getKey();
                HttpHeader header = request.header(key);

                boolean match = header.hasValueMatching(headerValuePattern);

                if (!match) {
                    notifier().info(String.format(
                            "URL %s is match, but header %s is not. For a match, value should %s",
                            request.getUrl(),
View Full Code Here

Examples of com.google.appengine.api.urlfetch.HTTPHeader

      HttpRequestOptions requestOptions) {

    String contentType = requestOptions.getContentType();

    if (contentType != null) {
      httpRequest.addHeader(new HTTPHeader("Content-Type", contentType));
    }

    Map<String, String> headers = getRequestHeaders(requestOptions);

    if (headers != null) {
      for (Map.Entry<String, String> header : headers.entrySet()) {
        httpRequest.addHeader(new HTTPHeader(header.getKey(), header.getValue()));
      }
    }
  }
View Full Code Here

Examples of com.google.appengine.api.urlfetch.HTTPHeader

        return header.getName().equalsIgnoreCase("Set-Cookie");
      }
    });
    if(!cookies.isEmpty()) {
      logCookies(cookies);
      HTTPHeader setcookie = cookies.iterator().next();
      String[] values = setcookie.getValue().split(";");
      if(values.length>0) {
        String value = values[0];
        if(value.split("=")[0].equalsIgnoreCase("jsessionid")) {
          // only update jsessionid cookies
          cookie = new HTTPHeader("Cookie", value);
        }
      }
    }
  }
View Full Code Here

Examples of com.google.appengine.api.urlfetch.HTTPHeader

    URL url = new URL(config.getJsonRpcServer());

    URLFetchService ufs = URLFetchServiceFactory.getURLFetchService();
    HTTPRequest req = new HTTPRequest(url, HTTPMethod.POST);
    req.setPayload(getwork.toString().getBytes());
    req.addHeader(new HTTPHeader("Authorization", config.getAuth()));

    HTTPResponse resp = ufs.fetch(req);
    String content = new String(resp.getContent());
    if (resp.getResponseCode() != 200) {
      throw new IOException( //
View Full Code Here

Examples of com.google.appengine.api.urlfetch.HTTPHeader

    URL url = new URL(config.getJsonRpcServer());
    URLFetchService ufs = URLFetchServiceFactory.getURLFetchService();
    HTTPRequest req = new HTTPRequest(url, HTTPMethod.POST);
    req.setPayload(getwork.toString().getBytes());
    req.addHeader(new HTTPHeader("Authorization", config.getAuth()));

    HTTPResponse resp = ufs.fetch(req);
    String content = new String(resp.getContent());
    if (resp.getResponseCode() != 200) {
      log.severe( //
View Full Code Here

Examples of com.google.appengine.api.urlfetch.HTTPHeader

    request = new HTTPRequest(new URL(url), method, OPTIONS);
  }

  @Override
  public void addHeader(String name, String value) {
    request.addHeader(new HTTPHeader(name, value));
  }
View Full Code Here

Examples of com.mojang.api.http.HttpHeader

    public Profile[] findProfilesByNames(String... names) {
        List<Profile> profiles = new ArrayList<Profile>();
        try {

            List<HttpHeader> headers = new ArrayList<HttpHeader>();
            headers.add(new HttpHeader("Content-Type", "application/json"));

            int namesCount = names.length;
            int start = 0;
            int i = 0;
            do {
View Full Code Here

Examples of http.content.header.HttpHeader

    InputStream in = null;
    /**
     * Attempts to open a FileInputStream on the file, this is used for
     * reading it's content.
     */
    HttpHeader header = new HttpHeader(socket, f.getPath());
    try {
      in = new BufferedInputStream(new FileInputStream(f));
      Log.fine("200: %s", f.getPath());
    } catch (FileNotFoundException e) {
      Log.fine("404: %s", get);
      try {
        socketOut.write(header.get404());
      } catch (IOException e1) {
        Log.fine("Unable to write 404 to output stream.");
      }
      return;
    }
    try {
      socketOut.write(header.get200());
    } catch (IOException e1) {
      Log.info("Unable to write header to output stream for: %s", getIp());
    }
    try {
      socketOut.write(header.getContentLength(in.available()));
      socketOut.write(CRLF.getBytes());
    } catch (IOException e1) {
      Log.info("Unable to write content length to the header for: %s",
          getIp());
      e1.printStackTrace();
View Full Code Here

Examples of net.matuschek.http.HttpHeader

      try {
        if (doc.isHTML() && (depth > 0)) {
          // solving encoding problem
          // HtmlDocument htmlDoc = new HtmlDocument(u, doc.getContent());
          HtmlDocument htmlDoc = null;
          HttpHeader contentTypeHeader = doc.getHeader("Content-type");
          if (contentTypeHeader != null) {
            String contentType = contentTypeHeader.getValue();
            int index = contentType.toLowerCase().indexOf("charset=");
            if (index > 0) {
              htmlDoc = new HtmlDocument(u, doc.getContent(), contentType.substring(index+8));
            } else {
              htmlDoc = new HtmlDocument(u, doc.getContent());
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.