Arachne
Types for HTTP and related RFCs.
Overview
Arachne is a library of types for working with HTTP and related standards. It contains data structures modelled on the RFCs for HTTP, URI, LanguageTag, plus other specs such as CORS, along with parsing and formatting code to reliably convert valid string representations to and from the Arachne types.
By having a fully defined data structure it becomes easy to pattern match over elements of complex types, or to use lenses to work with components of a complex type. It also gives you a level of confidence that your work with HTTP is reliable and safe - constructing an invalid instance of HTTP data using typed representations is a lot more difficult than working with raw strings!
Here's a couple of quick examples, showing the kinds of data structures contained and the results of parsing some simple values, in this case a URI and the value of an Accept header. Quite useful!
open Arachne.Http
open Arachne.Uri
Uri.Parse "http://www.example.com:80/path?query=str#fragment"
// =
Uri
(Scheme "http",
Authority
(Authority (Name (RegName "www.example.com"), Some (Port 80), None),
PathAbsoluteOrEmpty ["path"]), Some (Query "query=str"),
Some (Fragment "fragment"))
// --
Accept.Parse "text/*, text/html;q=0.7, text/html;level=1, */*"
// =
Accept
[ AcceptableMedia (Partial (Type "text", Parameters (map [])), None)
AcceptableMedia (Closed (Type "text", SubType "html", Parameters (map [])), Some (AcceptParameters (Weight 0.7, Extensions (map []))))
AcceptableMedia (Closed (Type "text", SubType "html", Parameters (map [ ("level", "1") ])), None)
AcceptableMedia (Open (Parameters (map [])), None) ]
Build status
Platform | BuildScript | Status of last build |
---|---|---|
Windows | build.cmd |
Packages
Name | NuGet |
---|---|
Arachne (meta) | |
Arachne.Core | |
Arachne.Uri | |
Arachne.Uri.Template | |
Arachne.Language | |
Arachne.Http | |
Arachne.Http.Cors |
Questions?
- Ask questions or submit issues on the issue tracker