Table of Contents

Class HttpRequest

Namespace
Sisk.Core.Http
Assembly
Sisk.Core.dll

Represents an HTTP request received by a Sisk server.

public sealed class HttpRequest
Inheritance
HttpRequest
Inherited Members

Properties

Authority

Get the requested host header with the port from this HTTP request.

Bag

Gets the managed object which holds data for an entire HTTP session.

Body

Gets the HTTP request body as string, decoded by the request content encoding.

ContentLength

Gets the content length in bytes count.

Context

Gets the HttpContext for this request.

Cookies

Gets an NameValueCollection object with all cookies set in this request.

FullPath

Gets the raw, full HTTP request path with the query string.

FullUrl

Gets the full URL for this request, with scheme, host, port, path and query.

HasContents

Gets a boolean indicating whether this request has body contents.

Headers

Gets the HTTP request headers.

Host

Get the requested host header (without port) from this HTTP request.

IsContentAvailable

Gets a boolean indicating whether the body content of this request has been processed by the server.

IsSecure

Gets a boolean indicating whether this request was made by an secure transport context (SSL/TLS) or not.

Method

Gets the HTTP request method.

Path

Gets the HTTP request path without the query string.

Query

Gets the HTTP request query extracted from the path string. This property also contains routing parameters.

QueryString

Gets the HTTP request URL raw query string.

RawBody

Gets the HTTP request body as a byte array.

RemoteAddress

Gets the incoming IP address from the request.

RequestEncoding

Gets an string Encoding that can be used to decode text in this HTTP request.

RequestId

Gets a unique random ID for this request.

RequestedAt

Gets the moment which the request was received by the server.

Methods

Close()

Closes this HTTP request and their connection with the remote client without sending any response.

GetContextBag<T>()

Gets an managed object from the HTTP context bag through it's type.

GetEventSource(string?)

Gets an Event Source interface for this request. Calling this method will put this HttpRequest instance in it's event source listening state.

GetFormContent()

Gets the values sent by a form in this request.

GetMultipartFormContent()

Gets the multipart form content for this request.

GetQueryValue(string)

Gets a query value using an case-insensitive search.

GetQueryValue<T>(string, T)

Gets the value stored from the Query and converts it to the given type.

GetRawHttpRequest(bool, bool)

Gets the raw HTTP request message from the socket.

GetRequestStream()

Gets the HTTP request content stream. This property is only available while the content has not been imported by the HTTP server and will invalidate the body content cached in this object.

GetResponseStream()

Gets an HTTP response stream for this HTTP request.

GetWebSocket(string?, string?)

Accepts and acquires a websocket for this request. Calling this method will put this HttpRequest instance in streaming state.

SendTo(RouteAction)

Calls another handler for this request, preserving the current call-stack frame, and then returns the response from it. This method manages to prevent possible stack overflows.

SetContextBag<T>()

Creates and stores a managed object in HTTP context bag through it's type.

SetContextBag<T>(T)

Stores a managed object in HTTP context bag through it's type.

ToString()

Gets an string representation of this HttpRequest object.