receiveHead(deadline:)
Waits for a message part to be received and checks that it was a .head
before returning the HTTPRequestHead
it contained.
func receiveHead(deadline: NIODeadline = .now() + .seconds(10)) throws -> HTTPRequestHead
Parameters
- deadline
The deadline by which a part must have been received.
Returns
The HTTPRequestHead
from the .head
.
Throws
If the part was not a .head
or nothing was read before the deadline.