zoukankan      html  css  js  c++  java
  • java network programming 第七章

    1。可以用在url中的字符
    • The capital letters A-Z

    • The lowercase letters a-z

    • The digits 0-9

    • The punctuation characters - _ . ! ~ * ' (and ,)

    2。URLEncoder.encode(,)方法:把空格变成+,其他非字符的符号用%和十六进制数表示。
    URLDecoder.decode(,)方法与之对应,一般第二个参数用"UTF-8"

    3。URI=URL+URN
    • The URI class is purely about identification of resources and parsing of URIs. It provides no methods to retrieve a representation of the resource identified by its URI.

    • The URI class is more conformant to the relevant specifications than the URL class.

    • A URI object can represent a relative URI. The URL class absolutizes all URIs before storing them.

    URI格式scheme:scheme-specific-part:fragment

    URI的几个方法,构造函数,relative函数,
    relativize函数。


    4。代理的几个方法
    a System Properties
    b Proxy类
        SocketAddress address = new InetSocketAddress("proxy.example.com", 80);
        Proxy proxy = new Proxy(Proxy.Type.HTTP, address);
    • Proxy.Type.DIRECT

    • Proxy.Type.HTTP

    • Proxy.Type.SOCKS

    c ProxySelector 类
       集成这个类并实现 public abstract List<Proxy> select(URI uri) 
    public void connectFailed(URI uri, SocketAddress address, IOException ex)
    这两个方法。
      

    5。


       




  • 相关阅读:
    信息安全系统设计基础第十二周学习总结
    day07-流程控制之while循环
    day07-深浅拷贝
    第一次小测
    day05-与用户交互与运算符
    day05学习笔记-垃圾回收机制
    day04学习笔记-变量
    day03-python-学习笔记
    P4323-[JSOI2016]独特的树叶【换根dp,树哈希】
    CF990G-GCD Counting【dfs】
  • 原文地址:https://www.cnblogs.com/goodloop/p/87482.html
Copyright © 2011-2022 走看看