Top Description Methods
org.apache.hc.core5.http.io

public Interface HttpServerConnection

extends BHttpConnection
Known Direct Implementers
org.apache.hc.core5.http.impl.io.DefaultBHttpServerConnection
Imports
java.io.IOException, org.apache.hc.core5.http.ClassicHttpRequest, .ClassicHttpResponse, .HttpException

A server-side HTTP connection, which can be used for receiving requests and sending responses.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public void
receiveRequestEntity(ClassicHttpRequest
the request to attach the entity to.
request
)

Receives the next request entity available from this connection and attaches it to an existing request.

public ClassicHttpRequest

Returns:

a new HttpRequest object whose request line and headers are initialized or null if the connection has been closed by the opposite endpoint.
receiveRequestHeader
()

Receives the request line and all headers available from this connection.

public void
sendResponseEntity(ClassicHttpResponse
the response whose entity to send.
response
)

Sends the response entity of a response over this connection.

public void
sendResponseHeader(ClassicHttpResponse
the response whose headers to send.
response
)

Sends the response line and headers of a response over this connection.

Inherited from org.apache.hc.core5.http.io.BHttpConnection:
flushisDataAvailableisStale

Method Detail

receiveRequestEntityback to summary
public void receiveRequestEntity(ClassicHttpRequest request) throws HttpException, IOException

Receives the next request entity available from this connection and attaches it to an existing request.

Parameters
request:ClassicHttpRequest

the request to attach the entity to.

Exceptions
HttpException:
in case of HTTP protocol violation
IOException:
in case of an I/O error
receiveRequestHeaderback to summary
public ClassicHttpRequest receiveRequestHeader() throws HttpException, IOException

Receives the request line and all headers available from this connection. The caller should examine the returned request and decide if to receive a request entity as well.

Returns:ClassicHttpRequest

a new HttpRequest object whose request line and headers are initialized or null if the connection has been closed by the opposite endpoint.

Exceptions
HttpException:
in case of HTTP protocol violation
IOException:
in case of an I/O error
sendResponseEntityback to summary
public void sendResponseEntity(ClassicHttpResponse response) throws HttpException, IOException

Sends the response entity of a response over this connection.

Parameters
response:ClassicHttpResponse

the response whose entity to send.

Exceptions
HttpException:
in case of HTTP protocol violation
IOException:
in case of an I/O error
sendResponseHeaderback to summary
public void sendResponseHeader(ClassicHttpResponse response) throws HttpException, IOException

Sends the response line and headers of a response over this connection.

Parameters
response:ClassicHttpResponse

the response whose headers to send.

Exceptions
HttpException:
in case of HTTP protocol violation
IOException:
in case of an I/O error