← All compilation units

Flyology.HTTP.Server.Requests

Description

Supplies lazy request-component helpers above an application exchange.

Authority

function Authority (X : Applications.Exchange) return String

Return the validated Host or request authority parsed by the core.

Parameters
X

Request exchange

Return value

Authority value

Content_Type_Parameter

function Content_Type_Parameter
  (X    : Applications.Exchange;
   Name : String) return String

Return one case-insensitive Content-Type parameter with optional quoted string unescaping. The first duplicate wins.

Parameters
X

Request exchange

Name

Parameter name

Return value

Parameter value or an empty string

Cookie

function Cookie (X : Applications.Exchange; Name : String) return String

Return one cookie value. Cookie names are case-sensitive; the first duplicate wins. Fields above 4096 bytes or 64 pairs are rejected.

Parameters
X

Request exchange

Name

Cookie name

Return value

Cookie value or an empty string

Has_Query

function Has_Query
  (X          : Applications.Exchange;
   Name       : String;
   Occurrence : Positive := 1) return Boolean

Report whether one decoded query occurrence exists.

Parameters
X

Request exchange

Name

Decoded case-sensitive key

Occurrence

One-based duplicate occurrence

Return value

True when the occurrence exists

Media_Type

function Media_Type (X : Applications.Exchange) return String

Return the lowercase media type portion of Content-Type.

Parameters
X

Request exchange

Return value

Media type or an empty string

Query

function Query
  (X          : Applications.Exchange;
   Name       : String;
   Occurrence : Positive := 1) return String

Return one decoded query occurrence. Names and values use percent decoding, and plus represents space only in the query. Duplicate keys retain wire order. Malformed escapes raise Protocol_Error.

Parameters
X

Request exchange

Name

Decoded case-sensitive key

Occurrence

One-based duplicate occurrence

Return value

Decoded value or an empty string