Commit 77699754975693d7692cf4e7e7341710f017f9a0

Authored by totoro
1 parent 41fbe378

add to_List_String of HTTP_Header.

This format the list of the couple Name, Value from HTTP_Header  into list of well formated "name: value" like in http header
Showing 1 changed file with 17 additions and 1 deletions   Show diff stats
web/CXM_common.anubis
... ... @@ -12,7 +12,8 @@
12 12 *Name* HTTP_header
13 13 *Description*
14 14  
15   -read system/string.anubis
  15 +transmit tools/basis.anubis
  16 +transmit system/string.anubis
16 17  
17 18 /**
18 19 * The type 'HTTP_header' describes HTTP headers, which are just pairs '(name,value)'.
... ... @@ -39,6 +40,21 @@ public define Maybe(String)
39 40 }
40 41 }.
41 42  
  43 +public define List(String)
  44 + to_List_String
  45 + (
  46 + List(HTTP_header) l
  47 + )=
  48 + map((HTTP_header h) |-> h.name +": "+h.value, l ).
  49 +
  50 +public define String
  51 + to_String
  52 + (
  53 + List(HTTP_header) l
  54 + )=
  55 + join("\n\r",to_List_String(l)).
  56 +
  57 +
42 58 *Name* Web_arg
43 59 *Description*
44 60  
... ...