Package org.springframework.http.server

# Interface ServerHttpRequest

All Superinterfaces:
  `HttpInputMessage`, `HttpMessage`, `HttpRequest`

All Known Implementing Classes:
  `RequestPartServletServerHttpRequest`, `ServletServerHttpRequest`

public interface ServerHttpRequest extends HttpRequest, HttpInputMessage
Represents a server-side HTTP request.

Since:
  3.0
Author:
  Arjen Poutsma, Rossen Stoyanchev

## Method Summary

Modifier and Type
Method
Description
`ServerHttpAsyncRequestControl`
`getAsyncRequestControl(ServerHttpResponse response)`
Return a control that allows putting the request in asynchronous mode so the response remains open until closed explicitly from the current or another thread.
`InetSocketAddress`
`getLocalAddress()`
Return the address on which the request was received.
`Principal`
`getPrincipal()`
Return a `Principal` instance containing the name of the authenticated user.
`InetSocketAddress`
`getRemoteAddress()`
Return the address of the remote client.

### Methods inherited from interface org.springframework.http.HttpInputMessage

`getBody`

### Methods inherited from interface org.springframework.http.HttpMessage

`getHeaders`

### Methods inherited from interface org.springframework.http.HttpRequest

`getAttributes, getMethod, getURI`

## Method Details

### getPrincipal

@Nullable Principal getPrincipal()
Return a `Principal` instance containing the name of the authenticated user.

If the user has not been authenticated, the method returns `null`.

### getLocalAddress

InetSocketAddress getLocalAddress()
Return the address on which the request was received.

### getRemoteAddress

InetSocketAddress getRemoteAddress()
Return the address of the remote client.

### getAsyncRequestControl

ServerHttpAsyncRequestControl getAsyncRequestControl(ServerHttpResponse response)
Return a control that allows putting the request in asynchronous mode so the response remains open until closed explicitly from the current or another thread.