Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 122 lines (108 sloc) 4.902 kb
fccc685 Initial open-source release
MLstate authored
1 %% -*-erlang-*-
2
3 %
4 % Copyright © 2011 MLstate
5 %
6 % This file is part of OPA.
7 %
8 % OPA is free software: you can redistribute it and/or modify it under the
9 % terms of the GNU Affero General Public License, version 3, as published by
10 % the Free Software Foundation.
11 %
12 % OPA is distributed in the hope that it will be useful, but WITHOUT ANY
13 % WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 % FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
15 % more details.
16 %
17 % You should have received a copy of the GNU Affero General Public License
18 % along with OPA. If not, see <http://www.gnu.org/licenses/>.
19 %
20
21 %% Request lines :
22 -raw RGet = "GET"i uri "HTTP/"it v "\r\n"
23 -raw RHead = "HEAD"i uri "HTTP/"it v "\r\n"
24 -raw RPost = "POST"i uri "HTTP/"it v "\r\n"
25 -raw RPut = "PUT"i uri "HTTP/"it v "\r\n"
26 -raw RDel = "DELETE"i uri "HTTP/"it v "\r\n"
27 -raw RTrace = "TRACE"i uri "HTTP/"it v "\r\n"
28 -raw RConn = "CONNECT"i uri "HTTP/"it v "\r\n"
29 -raw ROpts = "OPTIONS"i uri "HTTP/"it v "\r\n"
30
31 %%% Reponse <- Status line (header crlf)* crlf (Message body)?
32 %% Status-Line, v) = HTTP-Version SP Status-Code SP Reason-Phrase CRLF :
33 -raw RSl = "HTTP/" vs " " code int " " reason "\r\n"
34
35 %%%%%%%%%%%%%%%%%%%%%%%
36 %%% General headers %%%
37 %%%%%%%%%%%%%%%%%%%%%%%
38 -raw RCache_Control = "Cache-Control:"i str "\r\n"mt
39 -raw RConnection = "Connection:"i str "\r\n"mt
40 -raw RDate = "Date:"i str "\r\n"mt
41 -raw RPragma = "Pragma:"i str "\r\n"mt
42 -raw RTrailer = "Trailer:"i str "\r\n"mt
43 -raw RTransfer_Encoding = "Transfer-Encoding:"i str "\r\n"mt
44 -raw RUpgrade = "Upgrade:"i str "\r\n"mt
45 -raw RVia = "Via:"i str "\r\n"mt
46 -raw RWarning = "Warning:"i str "\r\n"mt
47 -raw RAllow = "Allow:"i str "\r\n"mt
48
49 %%%%%%%%%%%%%%%%%%%%%%
50 %%% Entity headers %%%
51 %%%%%%%%%%%%%%%%%%%%%%
52 -raw RContent_Encoding = "Content-Encoding:"i str "\r\n"mt
53 -raw RContent_Language = "Content-Language:"i str "\r\n"mt
54 -raw RContent_Length = "Content-Length:"i nb int64 "\r\n"mt
55 -raw RContent_Location = "Content-Location:"i str "\r\n"mt
56 -raw RContent_MD5 = "Content-MD5:"i str "\r\n"mt
57 -raw RContent_Range = "Content-Range:"i str "\r\n"mt
58 %-raw RContent_Type (str,lst : string list) = "Content-Type: " !"\r\n" !";" str (";" !";" !"\r\n" string)* as lst "\r\n"
59 -raw RContent_Type = "Content-Type:"i str ";" lst string list "\r\n"mt
60 %-raw RContent_Disposition (str,lst : string list) = "Content-Disposition: " !"\r\n" !";" str (";" !";" !"\r\n" string)* as lst "\r\n"
61 -raw RContent_Disposition = "Content-Disposition:"i str ";" lst string list "\r\n"mt
62 -raw RExpires = "Expires:"i str "\r\n"mt
63 -raw RLast_Modified = "Last-Modified:"i str "\r\n"mt
64
65 %%%%%%%%%%%%%%%%%%%%%%%%
66 %%% Requests headers %%%
67 %%%%%%%%%%%%%%%%%%%%%%%%
68 -raw RAccept = "Accept:"i str "\r\n"mt
69 -raw RAccept_Charset = "Accept-Charset:"i str "\r\n"mt
70 -raw RAccept_Encoding = "Accept-Encoding:"i str "\r\n"mt
71 -raw RAccept_Language = "Accept-Language:"i str "\r\n"mt
72 -raw RAuthorization = "Authorization:"i str "\r\n"mt
73 -raw RExpect = "Expect:"i str "\r\n"mt
74 -raw RFrom = "From:"i str "\r\n"mt
75 -raw RHost = "Host:"i str "\r\n"mt
76 -raw RIf_Match = "If-Match:"i str "\r\n"mt
77 -raw RIf_Modified_Since = "If-Modified-Since:"i str "\r\n"mt
78 -raw RIf_None_Match = "If-None-Match:"i str "\r\n"mt
79 -raw RIf_Range = "If-Range:"i str "\r\n"mt
80 -raw RIf_Unmodified_Since = "If-Unmodified-Since:"i str "\r\n"mt
81 -raw RKeep_Alive = "Keep-Alive:"i nb "\r\n"mt
82 -raw RMax_Forwards = "Max-Forwards:"i str "\r\n"mt
83 -raw RProxy_Authorization = "Proxy-Authorization:"i str "\r\n"mt
84 -raw RReqRange = "ReqRange:"i str "\r\n"mt
85 -raw RReferer = "Referer:"i str "\r\n"mt
86 -raw RTE = "TE:"i str "\r\n"mt
87 -raw RUser_Agent = "User-Agent:"i str "\r\n"mt
88
89 %%%%%%%%%%%%%%%%%%%%%%%%
90 %%% Response headers %%%
91 %%%%%%%%%%%%%%%%%%%%%%%%
92 -raw RAccept_Ranges = "Accept-Ranges:"i str "\r\n"mt
93 -raw RAge = "Age:"i str "\r\n"mt
94 -raw RETag = "ETag:"i str "\r\n"mt
95 -raw RLocation = "Location:"i str "\r\n"mt
96 -raw RProxy_Authenticate = "Proxy-Authenticate:"i str "\r\n"mt
97 -raw RRetry_After = "Retry-After:"i str "\r\n"mt
98 -raw RServer = "Server:"i str "\r\n"mt
99 -raw RVary = "Vary:"i str "\r\n"mt
100 -raw RWWW_Authenticate = "WWW-Authenticate:"i str "\r\n"mt
101
102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
103 %%% Uncategorised headers %%%
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105 -raw RSet_Cookie = "Set-Cookie:"i str "\r\n"mt % (coded) server updates UA
106 -raw RCookie = "Cookie:"i str "\r\n"mt % (coded) UA returns to server
107 -raw RMyCookie = "MyCookie:"i id "=" str "\r\n"mt % (uncoded) server keeps internal id
108
109 -raw RSet_Cookie2 = "Set-Cookie2:"i str "\r\n"mt
110 -raw RCookie2 = "Cookie2:"i str "\r\n"mt
111
112 -raw ROrigin = "Origin:"i str "\r\n"mt
113
114 %-raw Rendboundary = "--" b string "--\r\n"
115 -raw Rboundary = "--" b string "\r\n"mt
116 -raw Rpartial = "" str string "\r\n"
117 -raw Rbody = "" str string ""
118 -raw Rcrlf = "\r\n"
119
120 -raw Rtest = "Test:" i int "\r\n" str2 string list "\r\n" (parse_hdr1,hdr1_to_string)
121
Something went wrong with that request. Please try again.