|
3 | 3 | Author: Jan Wielemaker |
4 | 4 | E-mail: J.Wielemaker@vu.nl |
5 | 5 | WWW: http://www.swi-prolog.org |
6 | | - Copyright (c) 2002-2022, University of Amsterdam |
| 6 | + Copyright (c) 2002-2023, University of Amsterdam |
7 | 7 | VU University Amsterdam |
8 | 8 | CWI, Amsterdam |
9 | 9 | SWI-Prolog Solutions b.v. |
|
281 | 281 | % AtomValue is unified to the empty atom (''). |
282 | 282 | % |
283 | 283 | % * headers(-List) |
284 | | -% If provided, List is unified with a list of Name(Value) pairs |
285 | | -% corresponding to fields in the reply header. Name and Value |
286 | | -% follow the same conventions used by the header(Name,Value) |
287 | | -% option. See also raw_headers(-List) which provides the entire |
288 | | -% HTTP reply header in unparsed representation. |
| 284 | +% If provided, List is unified with a list of Name(Value) pairs |
| 285 | +% corresponding to fields in the reply header. Name and Value |
| 286 | +% follow the same conventions used by the header(Name,Value) |
| 287 | +% option. A pseudo header status_code(Code) is added to provide |
| 288 | +% the HTTP status as an integer. See also raw_headers(-List) |
| 289 | +% which provides the entire HTTP reply header in unparsed |
| 290 | +% representation. |
289 | 291 | % |
290 | 292 | % * method(+Method) |
291 | 293 | % One of =get= (default), =head=, =delete=, =post=, =put= or |
|
822 | 824 | return_version(Options, Version), |
823 | 825 | return_size(Options, Headers), |
824 | 826 | return_fields(Options, Headers), |
825 | | - return_headers(Options, Headers), |
| 827 | + return_headers(Options, [status_code(Code)|Headers]), |
826 | 828 | consider_keep_alive(Lines, Parts, Host, In0, In1, Options), |
827 | 829 | transfer_encoding_filter(Lines, In1, In, Options), |
828 | 830 | % properly re-initialise the stream |
|
1245 | 1247 |
|
1246 | 1248 | %! reply_header(+Lines, +Options) is det. |
1247 | 1249 | % |
1248 | | -% Return the entire reply header as a list of strings to te option |
1249 | | -% reply_headers(-Headers). |
| 1250 | +% Return the entire reply header as a list of strings to the option |
| 1251 | +% raw_headers(-Headers). |
1250 | 1252 |
|
1251 | 1253 | reply_header(Lines, Options) :- |
1252 | 1254 | option(raw_headers(Headers), Options), |
|
0 commit comments