2017-08-27

(sph web http)

procedures for working with http

highlights are the http date format reader/writer, query string to alist and backwards converter, and http-header-line-set-cookie

maturity: medium

status: should work

part of sph-lib

bindings

import name

(sph web http)

exports

http-current-date

procedure

signature

->

-> string

http-date->string

procedure

signature

a ->

sph-time-date-object -> string

http-header-line

procedure

signature

name value ->

string any -> string

description

create a header line

http-header-line-set-cookie

procedure

signature

name [value config] ->

string false/string alist:((symbol . string/boolean)) -> string

description

result in a header line for setting a cookie. config can contain key value pairs for following keys

domain

path

expires

max-age

secure

http-only

http-header-lines

procedure

signature

name/value ... ->

string ... -> string

http-parse-cookie-header

procedure

signature

ch ->

string -> alist

description

parse one header line for a cookie and retrieve its contents as key value pairs in an alist

http-parse-date

procedure

signature

str ->

http-parse-date->time

procedure

signature

a ->

string -> integer:seconds/false

http-read-header

procedure

signature

port ->

http-status-line

syntax

signature

code

http-uri-query-alist->string

procedure

signature

a ->

http-uri-query-string->alist

procedure

signature

a [separator] ->

string -> alist

description

assumes that uri is valid

http-utc->date

procedure

signature

a ->

integer:utc-nanoseconds-since-unix-epoch -> string

http-write-date

procedure

signature

date port ->

http-write-status-line

procedure

signature

code port ->


tags: programming guile documentation library scheme sph-lib sph-web-http