Code Monkey home page Code Monkey logo

httpclient-learn's Introduction

RFC核心概念

  1. Resources
  2. Representations
    1. A "representation" is information that is intended to reflect a past, current, or desired state of a given resource, in a format that can be readily communicated via the protocol. A representation consists of a set of representation metadata and a potentially unbounded stream of representation data
  3. Connections, Clients, and Servers
  4. Messages
  5. User Agents
  6. Origin Server
    1. The term "origin server" refers to a program that can originate authoritative responses for a given target resource.
  7. Intermediaries
  8. Caches

RFC报文格式

RFC对于http报文格式的定义 HTTP-message = start-line CRLF *( field-line CRLF ) CRLF [ message-body ]

start-line = request-line / status-line field-line = field-name ":" OWS field-value OWS message-body = *OCTET

request-line = method SP request-target SP HTTP-version method = token HTTP-version = HTTP-name "/" DIGIT "." DIGIT request-target = origin-form / absolute-form / authority-form / asterisk-form origin-form = absolute-path [ "?" query ]

status-line = HTTP-version SP status-code SP [ reason-phrase ]
reason-phrase = 1*( HTAB / SP / VCHAR / obs-text )

先理解RFC的定义,有助于理解httpclient的类

apache httpclient

HttpEntity是对RFC中的message-body的封装和加强

httpclient的样例

https://hc.apache.org/httpcomponents-client-4.5.x/examples.html

httpclient-learn's People

Contributors

maskedmarker avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.