在发送POST正文之前,Http服务器是否可以返回错误代码?

时间:2017-11-17 18:55:17

标签: apache http httpentity

如果无法访问Http服务器,并且Http客户端正在尝试向服务器发送POST请求,那么Post内容是否有机会被发送或者没有(假设错误代码返回且代码不会执行)?

更具体地说,我在writeTo函数中有特殊逻辑,我想知道如果Http服务器无法访问它是否被执行。

public interface HttpEntity {
  boolean isRepeatable();

  boolean isChunked();

  long getContentLength();

  Header getContentType();

  Header getContentEncoding();

  InputStream getContent() throws IOException, IllegalStateException;

  void writeTo(OutputStream var1) throws IOException;

  boolean isStreaming();

  void consumeContent() throws IOException;
}

0 个答案:

没有答案