Outgoing HTTP request sent by the client. More...
#include <HttpConnection.h>
Public Types | |
| enum class | BodyType : uint8_t { None , Manual , Span , Stream , Multipart } |
Public Member Functions | |
| void | reset () |
| Result | startRequest (HttpParser::Method method, StringSpan url) |
| Result | setExpectedBodyLength (uint64_t value) |
| Result | setBody (Span< const char > value) |
| Result | setBody (StringSpan value) |
| void | setBody (AsyncReadableStream &stream, uint64_t contentLengthValue) |
| void | setMultipart (HttpMultipartWriter &value) |
| Result | sendHeaders (Function< void(AsyncBufferView::ID)> callback={}) |
| HttpParser::Method | getMethod () const |
| StringSpan | getURL () const |
| BodyType | getBodyType () const |
| uint64_t | getContentLength () const |
Public Member Functions inherited from SC::HttpOutgoingMessage | |
| Result | addHeader (StringSpan headerName, StringSpan headerValue) |
| Writes an http header to this response. | |
| Result | sendHeaders (Function< void(AsyncBufferView::ID)> callback={}) |
| Start sending response headers, before sending any data. | |
| void | reset () |
| Resets this object for it to be re-usable. | |
| Result | end () |
| Finalizes the writable stream after sending all in progress writes. | |
| AsyncWritableStream & | getWritableStream () |
| Obtain writable stream for sending content back to connected client. | |
| void | setKeepAlive (bool keepAlive) |
| Sets whether to keep the connection alive after this response. | |
| bool | getKeepAlive () const |
| Gets whether the connection should be kept alive after this response. | |
Friends | |
| struct | HttpAsyncClient |
Additional Inherited Members | |
Protected Types inherited from SC::HttpOutgoingMessage | |
| enum class | KnownHeader : uint8_t { Connection , Host , UserAgent , ContentLength , ContentType , TransferEncoding } |
Protected Member Functions inherited from SC::HttpOutgoingMessage | |
| void | setHeaderMemory (Span< char > memory) |
| void | setWritableStream (AsyncWritableStream &stream) |
| bool | hasHeader (KnownHeader header) const |
| bool | hasSentHeaders () const |
| bool | hasEnded () const |
Protected Attributes inherited from SC::HttpOutgoingMessage | |
| HttpFixedBufferWriter | responseHeaders |
| Span< char > | headerMemory |
| bool | headersSent = false |
| bool | endCalled = false |
| bool | forceDisableKeepAlive = false |
| Whether keep alive has been force disabled permanently. | |
| bool | keepAlive = true |
| Whether to keep connection alive (HTTP/1.1 default) | |
| bool | connectionHeaderAdded = false |
| Whether Connection header was manually added. | |
| bool | hostHeaderAdded = false |
| bool | userAgentHeaderAdded = false |
| bool | contentLengthAdded = false |
| bool | contentTypeAdded = false |
| bool | transferEncodingAdded = false |
| AsyncWritableStream * | writableStream = nullptr |
Outgoing HTTP request sent by the client.