Examples of HttpRequest


转自: http://www.massapi.com/class/ht/HttpRequest.html


Examples of HttpRequest

Otherwise, the HTTP request will go directly to the host:
  • connect opens a connection to the remote host.
  • uses the "Connection" header to keep alive the connection.
  • sends a host-relative URL in the request line, for example "/index.html". The relative URL is derived from the fully qualified URL used to construct this HttpRequest.
header "Connection" or "Proxy-Connection"
The  HttpRequest sets the appropriate connection header to "Keep-Alive" to keep alive the connection to the host or proxy (respectively). By setting the appropriate connection header, the user can control whether the  HttpRequesttries to use Keep-Alives.
header "Host"
The HTTP/1.1 protocol requires that the "Host" header be set to the name of the machine being contacted. By default, this is derived from the URL used to construct the  HttpRequest, and is set automatically if the user does not set it.
header "Content-Length"
If the user calls  getOutputStream and writes some data to it, the "Content-Length" header will be set to the amount of data that has been written at the time that  connect is called.
Once all data has been read from the remote host, the underlying socket may be automatically recycled and used again for subsequent requests to the same remote host. If the user is not planning on reading all the data from the remote host, the user should call  close to release the socket. Although it happens under the covers, the user should be aware that if an IOException occurs or once data has been read normally from the remote host,  close is called automatically. This is to ensure that the minimal number of sockets are left open at any time.

The input stream that getInputStream provides automatically hides whether the remote host is providing HTTP/1.1 "chunked" encoding or regular streaming data. The user can simply read until reaching the end of the input stream, which signifies that all the available data from this request has been read. If reading from a "chunked" source, the data is automatically de-chunked as it is presented to the user. Currently, no access is provided to the underlying raw input stream. @author Colin Stevens (colin.stevens@sun.com) @version 2.5

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是五个解析延拓的例子: 1. 对于复平面上的单位圆 $S^1 = \{z\in\mathbb{C}: |z|=1\}$,定义函数 $f(z) = \frac{1}{1-z}$,则该函数在单位圆内有定义,且在圆上连续。可以使用柯西积分公式将其解析延拓到整个复平面上,得到函数 $F(z) = \frac{1}{1-z}$,其中 $z\neq 1$。这个例子是解析延拓中的经典案例。 2. 定义函数 $f(z) = \sqrt{z}$,则该函数在 $z=0$ 处不解析,因为在 $z=0$ 的不同方向上取极限得到的结果不同。但是,我们可以通过在 $z=0$ 处取一个极点并定义一条割线来使其解析延拓。例如,我们可以定义割线 $\gamma$ 为从原点出发的实轴正半轴,然后将 $\sqrt{z}$ 沿 $\gamma$ 切开,从而将其延拓为沿割线的两个分支 $f_+(z)$ 和 $f_-(z)$,分别满足 $f_+(0) = 0$ 和 $f_-(0) = 0$。 3. 定义函数 $f(z) = \frac{\sin(z)}{z}$,则该函数在 $z=0$ 处有一个可去奇点。我们可以通过将 $f(z)$ 定义为在 $z=0$ 处的极限值来将其解析延拓到整个复平面上,即 $f(z) = \lim_{w\to 0}\frac{\sin(zw)}{zw}$。 4. 定义函数 $f(z) = e^{1/z}$,则该函数在 $z=0$ 处有一个本质奇点。我们可以将其解析延拓到复平面上除了原点外的所有点,定义 $F(z) = e^{1/z}$,其中 $z\neq 0$。 5. 定义函数 $f(z) = \sum_{n=0}^\infty z^n$,则该函数在 $|z| < 1$ 内解析,在 $|z| \geq 1$ 外不解析。但是,我们可以将其解析延拓到整个复平面上,得到 $F(z) = \frac{1}{1-z}$,其中 $z\neq 1$。这个例子与第一个例子非常相似,但是它的解析延拓方式略有不同。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值