packages-http
packages-http copied to clipboard
The SWI-Prolog HTTP server and client libraries
The JSON string `"\ud83d\udc95"` has one codepoint, not two. This is because the spec allows extended characters to be encoded as a pair of 16-bit values, called a "surrogate pair"....
There are a number of inconsistencies between what's exported, what's documented for the predicate, and what's actually defined for `http_reply` and `http_status_reply` in [`http_header.pl`](https://github.com/SWI-Prolog/packages-http/blob/aeb159a104be39091b1fa046755e48aa89b05667/http_header.pl). Also, note that `Status` is mentioned...
Certain meta-predicates like page/4 are defined in `html_write.pl` and used elsewhere (for instance, in `http_header.pl`). They are explicitly imported in http_head but not exported in html_write. This results in socket...
prolog_to_json fails when a json_object is used as a type for a field in another json_object. It seems that the type check for a record, which is called in the...
…ithout any loss of precision. See issue #130 This isn't especially elegant, but it's simple and seems to do the job!
The following non-terminal is also declared as multifile at line 99: https://github.com/SWI-Prolog/packages-http/blob/d6402f72e4a6daa293821ac62e799f736096b5a1/html_write.pl#L714-L715
After issue #128, I realised that there's a problem going the other way as well. When we receive a value that we know is a number, we use number_codes/2 to...
Currently `http_open/3` does not seem to comply to the encoding set by the `Content-Type` reply header. While the encoding is claimed to be UTF-8, the content clearly contains incorrect characters...
http_dispatch:http_request_expansion/2 should be meta_predicate(3, +) and isn't.
**Use case**: I would like to serve UTF-8 encoded `*.txt` files. When I use the following server: :- use_module(library(http/thread_httpd)). :- use_module(library(http/http_unix_daemon)). :- use_module(library(http/http_files)). :- http_handler(root(.), http_reply_from_files(., []), [prefix]). then I...