IT. Expert System.

Android Reference

EventHandler


android.net.http

Interface EventHandler

  • All Known Implementing Classes:
    LoggingEventHandler, TestEventHandler


    public interface EventHandler
    Callbacks in this interface are made as an HTTP request is processed. The normal order of callbacks is status(), headers(), then multiple data() then endData(). handleSslErrorRequest(), if there is an SSL certificate error. error() can occur anywhere in the transaction.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      void certificate(SslCertificate certificate)
      SSL certificate callback called before resource request is made, which will be null for insecure connection.
      void data(byte[] data, int len)
      An array containing all or part of the http body as read from the server.
      void endData()
      Called when the document is completely read.
      void error(int id, String description)
      There was trouble.
      boolean handleSslErrorRequest(SslError error)
      SSL certificate error callback.
      void headers(Headers headers)
      Called after all headers are successfully processed.
      void status(int major_version, int minor_version, int code, String reason_phrase)
      Called after status line has been sucessfully processed.
    • Field Detail

      • ERROR_LOOKUP

        static final int ERROR_LOOKUP
        Server or proxy hostname lookup failed
        See Also:
        Constant Field Values
      • ERROR_UNSUPPORTED_AUTH_SCHEME

        static final int ERROR_UNSUPPORTED_AUTH_SCHEME
        Unsupported authentication scheme (ie, not basic or digest)
        See Also:
        Constant Field Values
      • ERROR_AUTH

        static final int ERROR_AUTH
        User authentication failed on server
        See Also:
        Constant Field Values
      • ERROR_PROXYAUTH

        static final int ERROR_PROXYAUTH
        User authentication failed on proxy
        See Also:
        Constant Field Values
      • ERROR_CONNECT

        static final int ERROR_CONNECT
        Could not connect to server
        See Also:
        Constant Field Values
      • ERROR_IO

        static final int ERROR_IO
        Failed to write to or read from server
        See Also:
        Constant Field Values
      • ERROR_REDIRECT_LOOP

        static final int ERROR_REDIRECT_LOOP
        Too many redirects
        See Also:
        Constant Field Values
      • ERROR_UNSUPPORTED_SCHEME

        static final int ERROR_UNSUPPORTED_SCHEME
        Unsupported URI scheme (ie, not http, https, etc)
        See Also:
        Constant Field Values
      • ERROR_FAILED_SSL_HANDSHAKE

        static final int ERROR_FAILED_SSL_HANDSHAKE
        Failed to perform SSL handshake
        See Also:
        Constant Field Values
      • FILE_ERROR

        static final int FILE_ERROR
        Generic file error for file:/// loads
        See Also:
        Constant Field Values
      • FILE_NOT_FOUND_ERROR

        static final int FILE_NOT_FOUND_ERROR
        File not found error for file:/// loads
        See Also:
        Constant Field Values
      • TOO_MANY_REQUESTS_ERROR

        static final int TOO_MANY_REQUESTS_ERROR
        Too many requests queued
        See Also:
        Constant Field Values
    • Method Detail

      • status

        void status(int major_version,
                  int minor_version,
                  int code,
                  String reason_phrase)
        Called after status line has been sucessfully processed.
        Parameters:
        major_version - HTTP version advertised by server. major is the part before the "."
        minor_version - HTTP version advertised by server. minor is the part after the "."
        code - HTTP Status code. See RFC 2616.
        reason_phrase - Textual explanation sent by server
      • headers

        void headers(Headers headers)
        Called after all headers are successfully processed.
      • data

        void data(byte[] data,
                int len)
        An array containing all or part of the http body as read from the server.
        Parameters:
        data - A byte array containing the content
        len - The length of valid content in data Note: chunked and compressed encodings are handled within android.net.http. Decoded data is passed through this interface.
      • endData

        void endData()
        Called when the document is completely read. No more data() callbacks will be made after this call
      • certificate

        void certificate(SslCertificate certificate)
        SSL certificate callback called before resource request is made, which will be null for insecure connection.
      • error

        void error(int id,
                 String description)
        There was trouble.
        Parameters:
        id - One of the error codes defined below
        description - of error
      • handleSslErrorRequest

        boolean handleSslErrorRequest(SslError error)
        SSL certificate error callback. Handles SSL error(s) on the way up to the user. The callback has to make sure that restartConnection() is called, otherwise the connection will be suspended indefinitely.
        Returns:
        True if the callback can handle the error, which means it will call restartConnection() to unblock the thread later, otherwise return false.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 193 / 158862679. Delta: 0.06238 с