HttpClient Study Record (ii)

Source: Internet
Author: User

The 1.message header contains the properties of some message headers, such as content length, content type

Here is a simple get header for the same response:

Another way to get it is to use an iterator: using the Headeriterator interface to get the header

Provides a handy way to format an HTTP message header, which looks more intuitive:

Httpentity: The data class volume returned from the server, the header message is removed;

HttpClient can only identify three types of entity:

Streamed: The flow of the situation, generally returned from the response, such entities are generally not repeated;

Self-contained: The entity of this situation is generally in memory, or a separate connection and entity, and is repeatable; This type is often used in closed HTTP requests.

Wrapping: Generally wrapped in other entities;

In the case, it's suggested to
Consider non-repeatable entities as streamed, and those that is repeatable as self-contained.

In this case, it is recommended that
Consider non-repeatable entities as streams, and those that are repeatable, as independent.

An entity is repeatable, meaning it will be read more than once,

This is a possible with
Self contained entities (like bytearrayentity or stringentity)

This is the only possible when using the self-contained type, such as bytearrayentity (byte array entity) and stringentity (string entity)

HttpClient Study Record (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.