std/url: URLs read, written, resolved and percent-encoded
The standard library chapter gets std/url after std/http: the quoted literal that encodes each value for its part, parse-url's strict reading, the round trip, url-resolve, the decoded parts and the encoders. modules/std/url.sz is the reference page, generated from (std url)'s docs. 🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-4-7) Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
parent
1b4493700d
commit
40f4783fa5
2 changed files with 8 additions and 0 deletions
|
|
@ -29,6 +29,11 @@ For more details, see @link["modules/std/rx.html"]{@code{(std rx)}}.
|
|||
The @code{std/http} module allows you to build and send HTTP requests. Sending a request three ways — blocking, suspending, or as an event — is the only thing that differs between the entry points. There is no C# in this module: @code{System.Net.Http} is reached with @code{import/extern}, and the response body is an ordinary @code{TextInputPort}.
|
||||
For more details, see @link["modules/std/http.html"]{@code{(std http)}}.
|
||||
|
||||
@subsection{std/url}
|
||||
|
||||
URLs by RFC 3986. A URL is written as a quoted literal, as @code{(std run)} writes a pipeline: @code{(link '(url https "example.com" (path "users" ,name) (query (page 2) (tag ,tag)) (fragment "top")))}, or @code{'(path "users" ,id "edit")} for a path on this site. Each value is encoded for the part that it is in, so a @code{/} in a computed segment does not make a second segment, and a @code{&} in a computed value does not make a second parameter. The compiler checks the parts of a literal where it is written. @code{parse-url} reads a URL or a relative reference strictly, and refuses text that is not one with the column where it goes wrong. A @code{Url} keeps each part as it was written, so @code{url->string} gives back the same text. @code{url-resolve} reads a link where a page is. @code{url-segments} and @code{url-params} decode the path and the query, and there is one percent-encoder for each part of a URL.
|
||||
For more details, see @link["modules/std/url.html"]{@code{(std url)}}.
|
||||
|
||||
@subsection{std/run}
|
||||
|
||||
The @code{std/run} module provides a way to run external programs. A form is one thing to run, written as a quoted literal, like @code{'(cat "hej.txt")}. You can connect programs in a pipe with @code{'(pipe (cat "a") (wc -l))}, and redirect input and output to files. Redirections can nest, and you can even splice computed arguments or write stages in Bjolang.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue