# Remove meta from reply\_html\_page

**URL:** <https://swi-prolog.discourse.group/t/remove-meta-from-reply-html-page/4189>\
**Category:** Pack\
**Tags:** http, framework-benchmarks\
**Created:** [July 23, 2021, 10:11am UTC](https://swi-prolog.discourse.group/t/remove-meta-from-reply-html-page/4189 "2021-07-23T10:11:32Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [July 23, 2021, 12:32pm UTC](https://swi-prolog.discourse.group/t/remove-meta-from-reply-html-page/4189/8 "2021-07-23T12:32:00Z")

</div>

Here is something that works:

```prolog
:- use_module(library(http/http_server)).
:- use_module(library(http/html_write)).
:- use_module(library(dcg/high_order)).

run :-
    http_server([port(8080)]).

:- http_handler(root(.), reply, []).

reply(_Request) :-
    findall(row(N,C), row(N,C), Rows),
    phrase(page([ head(title('Fortunes')),
                  body(table(\sequence(row, Rows)))
                ]),
           Tokens),
    format('Content-type: text/html~n~n'),
    print_html(Tokens).

row(row(N, C)) -->
    html(tr([td(N), td(C)])).

% data
row(1, 'こんにちは').
row(2, '<alert>Good bye</alert>').

```

And here is the output:

```prolog
$ curl -D hdr http://localhost:8080/
<!DOCTYPE html>
<html>
<head>
<title>Fortunes</title>

</head>
<body>

<table>
<tr><td>1</td><td>こんにちは</td></tr>
<tr><td>2</td><td>&lt;alert&gt;Good bye&lt;/alert&gt;</td></tr>
</table>

</body>
</html>

```

```prolog
$ cat hdr
HTTP/1.1 200 OK
Date: Fri, 23 Jul 2021 12:30:22 GMT
Content-Type: text/html; charset=UTF-8
Connection: Keep-Alive
Content-Length: 213

```

Edit: may require 8.3.x. Not sure when sequence//2 was added to the library.

---

_[View the full topic](https://swi-prolog.discourse.group/t/remove-meta-from-reply-html-page/4189)._
