A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jamesnvc/http2_client below:

jamesnvc/http2_client: Prolog HTTP/2 Client. Mirror of https://gitlab.com/jamesnvc/prolog_http2_client

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).

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4