(rfc http-connections) - HTTP client utilities

Library (rfc http)

This library provides common interfaces of (rfc http) and (rfc http2) library.

Function http-connection? obj

Returns #t if the given object is an HTTP connection.

Function http1-connection? obj

Returns #t if the given object is an HTTP/1.1 connection.

Function make-http1-connection server secure?

Creates an HTTP/1.1 connection with destination server server.

If the secure? is true value, then it uses TLS socket.

The HTTP/1.1 connection uses http-request defined in (rfc http)library to send an request.

Function http2-connection? obj

Returns #t if the given object is an HTTP/2 connection.

Function make-http2-connection server secure?

Creates an HTTP/2 connection with destination server server.

If the secure? is true value, then it uses TLS socket.

The HTTP/1.1 connection uses http2-request defined in (rfc http2)library to send an request.

Function http-connection-secure? http-connection

Returns #t if the given http-connection uses TLS socket to connect target server.

Function http-connection-server http-connection

Returns destination server of the http-connection as string.

Function http-connection-server&port http-connection

Returns destination server and port of the http-connection.

Function open-http-connection! http-connection

Opens given http-connection and returns it.

Function close-http-connection! http-connection

Closes given http-connection and returns it.

Function http-request http-connection method path . opt

Sends HTTP request to the path path of destination server of http-connection with HTTP method methos.

The rest value of opt is passed to underling request sending procedure.

The procedure returns 3 values, HTTP status, HTTP header and content as bytevector.

Generic http-null-receiver
Method http-null-receiver (conn http1-connection)
Method http-null-receiver (conn http2-connection)

Generic method of null http receiver.

The http-null-receiver forwards http-null-receiver defined in (rfc http) for http1-connection and http2-null-receiver defined in (rfc http2) for http2-connection

Generic http-oport-receiver
Method http-oport-receiver (conn http1-connection) sink flusher
Method http-oport-receiver (conn http2-connection) sink flusher

Generic method of output port http receiver.

The http-oport-receiver forwards http-oport-receiver defined in (rfc http) for http1-connection and http2-data-receiver defined in (rfc http2) for http2-connection

Generic http-blob-sender
Method http-blob-sender (conn http1-connection) blob
Method http-blob-sender (conn http2-connection) blob

Generic method of http blob sender.

The http-blob-sender forwards http-blob-sender defined in (rfc http) for http1-connection and http2-data-sender defined in (rfc http2) for http2-connection

Generic http-string-sender
Method http-string-sender (conn http1-connection) string
Method http-string-sender (conn http2-connection) string

Generic method of http string sender.

The http-string-sender forwards http-string-sender defined in (rfc http) for http1-connection and http2-data-sender defined in (rfc http2) with given string converted by string->utf8 procedure defined for http2-connection

Generic http-null-sender
Method http-null-sender (conn http1-connection)
Method http-null-sender (conn http2-connection)

Generic method of http null sender.

The http-null-sender forwards http-null-sender defined in (rfc http) for http1-connection and does nothing for http2-connection.