API Reference

Common Defintions

 
   HTTP_Major_Version : constant Positive := 1; 
   HTTP_Minor_Version : constant Positive := 1; 
 
   HTTP_Version       : constant String := 
     "HTTP/" & Integer'Image(HTTP_Major_Version) & '.'  & Integer'Image(HTTP_Minor_Version); 
 

This is the version of HTTP that is used as a reference for

these implementation. The protocol itself is defined in RFC 2616

"Hypertext Transfer Protocol

   Default_Port : constant Integer := 80; 

The default port used for HTTP connections

The standard methods defined by HTTP 1.1

   Options_Method : constant String := "OPTION"; 
   Get_Method     : constant String := "GET"; 
   Head_Method    : constant String := "HEAD"; 
   Post_Method    : constant String := "POST"; 
   Put_Method     : constant String := "PUT"; 
   Delete_Method  : constant String := "DELETE"; 
   Trace_Method   : constant String := "TRACE"; 

The standard status codes defined by HTTP 1.1

   Continue                      : constant Integer := 100; 
   Switching_Protocols           : constant Integer := 101; 
   OK                            : constant Integer := 200; 
   Created                       : constant Integer := 201; 
   Accepted                      : constant Integer := 202; 
   Non_Authoritive_Information   : constant Integer := 203; 
   No_Content                    : constant Integer := 204; 
   Reset_Content                 : constant Integer := 205; 
   Partial_Content               : constant Integer := 206; 
   Multiple_Choices              : constant Integer := 300; 
   Moved_Permamently             : constant Integer := 301; 
   Found                         : constant Integer := 302; 
   See_Other                     : constant Integer := 303; 
   Not_Modified                  : constant Integer := 304; 
   Use_Proxy                     : constant Integer := 305; 
   Temporary_Redirect            : constant Integer := 307; 
   Bad_Request                   : constant Integer := 400; 
   Unauthorized                  : constant Integer := 401; 
   Payment_Required              : constant Integer := 402; 
   Forbidden                     : constant Integer := 403; 
   Not_Found                     : constant Integer := 404; 
   Method_Not_Allowed            : constant Integer := 405; 
   Not_Acceptable                : constant Integer := 406; 
   Proxy_Authentication_Required : constant Integer := 407; 
   Request_Time_Out              : constant Integer := 408; 
   Conflict                      : constant Integer := 409; 
   Gone                          : constant Integer := 410; 
   Length_Required               : constant Integer := 411; 
   Precondition_Failed           : constant Integer := 412; 
   Request_Entity_Too_Large      : constant Integer := 413; 
   Request_URI_Too_Large         : constant Integer := 414; 
   Unsuppourted_Media_Type       : constant Integer := 415; 
   Requested_Range_Not_Satisfiable : constant Integer := 416; 
   Expectation_Failed            : constant Integer := 417; 
   Internal_Server_Error         : constant Integer := 500; 
   Not_Implemented               : constant Integer := 501; 
   Bad_Gateway                   : constant Integer := 502; 
   Service_Unavailable           : constant Integer := 503; 
   Gateway_Timeout               : constant Integer := 504; 
   Http_Version_Not_Supported    : constant Integer := 505; 

The standard headers defined by HTTP 1.1 in section 14

   Accept_Field              : constant Field_Name := To_Unbounded_String("Accept"); 
   Accept_Charset_Field      : constant Field_Name := To_Unbounded_String("Accept-Charset"); 
   Accept_Encoding_Field     : constant Field_Name := To_Unbounded_String("Accept-Encoding"); 
   Accept_Language_Field     : constant Field_Name := To_Unbounded_String("Accept-Language"); 
   Accept_Ranges_Field       : constant Field_Name := To_Unbounded_String("Accept-Ranges"); 
   Age_Field                 : constant Field_Name := To_Unbounded_String("Age"); 
   Allow_Field               : constant Field_Name := To_Unbounded_String("Allow"); 
   Authorization_Field       : constant Field_Name := To_Unbounded_String("Authorization"); 
   Cache_Control_Field       : constant Field_Name := To_Unbounded_String("Cache-Control"); 
   Connection_Field          : constant Field_Name := To_Unbounded_String("Connection"); 
   Content_Encoding_Field    : constant Field_Name := To_Unbounded_String("Content-Encoding"); 
   Content_Language_Field    : constant Field_Name := To_Unbounded_String("Concent-Language"); 
   Content_Length_Field      : constant Field_Name := To_Unbounded_String("Content-Length"); 
   Content_Location_Field    : constant Field_Name := To_Unbounded_String("Content-Location"); 
   Content_MD5_Field         : constant Field_Name := To_Unbounded_String("Content-MD5"); 
   Content_Range_Field       : constant Field_Name := To_Unbounded_String("Content-Range"); 
   Content_Type_Field        : constant Field_Name := To_Unbounded_String("Content-Type"); 
   Date_Field                : constant Field_Name := To_Unbounded_String("Date"); 
   ETag_Field                : constant Field_Name := To_Unbounded_String("ETag"); 
   Expect_Field              : constant Field_Name := To_Unbounded_String("Expect"); 
   Expires_Field             : constant Field_Name := To_Unbounded_String("Expires"); 
   From_Field                : constant Field_Name := To_Unbounded_String("From"); 
   Host_Field                : constant Field_Name := To_Unbounded_String("Host"); 
   If_Match_Field            : constant Field_Name := To_Unbounded_String("If-Match"); 
   If_Modified_Since_Field   : constant Field_Name := To_Unbounded_String("If-Modified-Since"); 
   If_None_Match_Field       : constant Field_Name := To_Unbounded_String("If-None-Match"); 
   If_Range_Field            : constant Field_Name := To_Unbounded_String("If-Range"); 
   If_Unmodified_Since_Field : constant Field_Name := To_Unbounded_String("If-Unmodified-Since"); 
   Last_Modified_Field       : constant Field_Name := To_Unbounded_String("Last-Modified"); 
   Location_Field            : constant Field_Name := To_Unbounded_String("Location"); 
   Max_Forwards_Field        : constant Field_Name := To_Unbounded_String("Max-Forwards"); 
   Pragma_Field              : constant Field_Name := To_Unbounded_String("Pragma"); 
   Proxy_Authenticate_Field  : constant Field_Name := To_Unbounded_String("Proxy-Authenticate"); 
   Proxy_Authorization_Field : constant Field_Name := To_Unbounded_String("Proxy-Authorization"); 
   Range_Field               : constant Field_Name := To_Unbounded_String("Range"); 
   Referer_Field             : constant Field_Name := To_Unbounded_String("Referer"); 
   Retry_After_Field         : constant Field_Name := To_Unbounded_String("Retry-After"); 
   Server_Field              : constant Field_Name := To_Unbounded_String("Server"); 
   TE_Field                  : constant Field_Name := To_Unbounded_String("TE"); 
   Trailer_Field             : constant Field_Name := To_Unbounded_String("Trailer"); 
   Transfer_Encoding_Field   : constant Field_Name := To_Unbounded_String("Transfer-Encoding"); 
   Upgrade_Field             : constant Field_Name := To_Unbounded_String("Upgrade"); 
   User_Agent_Field          : constant Field_Name := To_Unbounded_String("User-Agent"); 
   Vary_Field                : constant Field_Name := To_Unbounded_String("Vary"); 
   Via_Field                 : constant Field_Name := To_Unbounded_String("Via"); 
   Warning_Field             : constant Field_Name := To_Unbounded_String("Warning"); 
   WWW_Authenticate_Field    : constant Field_Name := To_Unbounded_String("WWW-Authenticate"); 

procedure Version , function Status_Code , function Reason_Phrase , subtype URI , subtype Request_Line , function Build_Request_Line , function Method , function Request_Uri , function Version

   procedure Version (Status : in     Status_Line;  
                      Name   :    out Unbounded_String; 
                      Major  :    out Positive; 
                      Minor  :    out Positive); 
 
   function Status_Code (Status : in Status_Line) return Integer; 
 
   function Reason_Phrase (Status : in Status_Line) return Unbounded_String; 
 
   subtype URI is String; 
 
   subtype Request_Line is String; 
 
   function Build_Request_Line (Method      : in String; 
                                Request_Uri : in URI; 
                                Version     : in String := 
                                  Http_Version) return Request_Line; 
 
   function Method (Request : in Request_Line) return String; 
 
   function Request_Uri (Request : in Request_Line) return URI; 
 
   function Version (Request : in Request_Line) return String;