Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | An HTTP/2 client |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 1.0.0 |
SHA1 sum: | c7b2f187ca7b075428f11bce29024a4526d5df60 |
Author: | James N. V. Cash <james.cash@occasionallycogent.com> |
Home page: | https://gitlab.com/jamesnvc/prolog_http2_client |
Download URL: | https://github.com/jamesnvc/http2_client/releases/*.zip |
Requires: | delay |
edcg | |
list_util | |
Provides: | http2_client |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
0.1.0 | c0a17f9f4f868eaf62d8c3d222a75b58c10c0d39 | 2 | https://github.com/jamesnvc/http2_client/archive/v0.1.0.zip |
0.4.0 | faea138bbfda7465660466735dbc1968f7457b52 | 1 | https://github.com/jamesnvc/http2_client/archive/v0.4.0.zip |
0.6.0 | e9c9a4d188488ca44c947a0b6e726d17a512d0ae | 1 | https://github.com/jamesnvc/http2_client/archive/v0.6.0.zip |
0.6.1 | 3642e46c90fee0131dbd1e8f0d7d822b2060906c | 1 | https://github.com/jamesnvc/http2_client/archive/v0.6.1.zip |
0.6.2 | 43bc2997b0715de43fb99d9561bdbaa6c0ccf66a | 1 | https://github.com/jamesnvc/http2_client/archive/v0.6.2.zip |
0.7.0 | dc6a0ed15438cc678e3fde9df30e5b1252d6540b | 3 | https://github.com/jamesnvc/http2_client/archive/v0.7.0.zip |
1.0.0 | c7b2f187ca7b075428f11bce29024a4526d5df60 | 64 | https://github.com/jamesnvc/http2_client/archive/v1.0.0.zip |
This library is a work in progress
It currently does not support server push and assumes correct input from servers -- it is not robust in the face of server errors or invalid data being sent.
Only HTTP/2 over TLS is supported, which requires SWI-Prolog 7.7.19 or greater for TLS-ALPN support.
It is available as an SWI pack and can be installed by running ?- pack_install(http2_client)
.
Contributions extremely welcome
Requires the list_util
and delay
packs.
Uses the reif library.
:- use_module(library(http2_client)). test_close_cb(Ctx, Data) :- debug(xxx, ">>> server closed ~w", [Data]), http2_close(Ctx). test_cb(Ident, Headers, Body) :- debug(xxx, ">>>>> ~w~n>>> headers ~w~n>>>body ~s...", [Ident, Headers, Body]). test(Ctx) :- debug(xxx), http2_open('https://nghttp2.org', Ctx, [close_cb(http2_test:test_close_cb(Ctx))]), http2_request(Ctx, [':method'-'GET', ':path'-'/httpbin/ip'], [], test_cb(ip)), http2_request(Ctx, [':method'-'GET', ':path'-'/httpbin/headers'], [], test_cb(headers)), http2_request(Ctx, [':method'-'GET', ':path'-'/httpbin/get'], [], test_cb(get)). ?- test(Ctx).
Pack contains 12 files holding a total of 92.1K bytes.