API cross-reference
All ten clients implement one API
contract. This page maps each concept to its name in every language. Arguments are abbreviated: url
is a URL (Java and Kotlin URI, C# Uri, Swift URL, Rust impl IntoUrl, otherwise a string). Go methods also take a leading
ctx, Rust request builders are awaited, and C# methods are awaited and take an optional trailing
CancellationToken. Swift methods are try awaited, and listings are for try awaited. PHP options are named
arguments (slug:, ifMatch:) and listings are foreached. Kotlin functions are suspend, options are
named arguments (slug =, ifMatch =), and listings are Flows that are collected.
Client and configuration
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Client | LwsClient.builder()…build() | new LwsClient({…}) | lws::Client(ClientOptions) | Client::builder()…build()? | lws.NewClient(opts...) | LwsClient(…) / AsyncLwsClient(…) | new LwsClient(new LwsClientOptions { … }) | LWSClient(options: LWSClientOptions(…)) | new LwsClient(authenticator: …, …) | LwsClient(authenticator = …, …) |
| Concurrency model | blocking, plus *Async → CompletableFuture | Promise / async | blocking (thread-safe) | async (tokio) | blocking + context.Context | sync and asyncio clients | async / await (Task, CancellationToken) | async throws (task cancellation) | synchronous, with a per-request timeout | suspend functions (coroutine cancellation), Flow listings |
| Authenticator | .authenticator(a) | { authenticator } | options.authenticator | .authenticator(a) | lws.WithAuthenticator(a) | authenticator=a | Authenticator = a | LWSClientOptions(authenticator: a) | new LwsClient(authenticator: $a) | LwsClient(authenticator = a) |
| HTTP engine | .httpClient(HttpClient) | { fetch } | options.transport (HttpTransport) | .http_client(reqwest::Client) | lws.WithHTTPClient(*http.Client) | http_client=httpx.Client | HttpClient = … / HttpMessageHandler = … | LWSClientOptions(transport: HTTPTransport) | transport: new CurlTransport() | new Psr18Transport(…) | transport = JdkHttpTransport(HttpClient) | HttpTransport { … } |
| User-Agent / headers | .userAgent(s) .header(k, v) | { userAgent, headers } | options.user_agent / default_headers | .user_agent(s) .default_header(k, v) | lws.WithUserAgent(s) lws.WithHeader(k, v) | user_agent=, default_headers= | UserAgent = s, DefaultHeaders = {…} | userAgent: s, defaultHeaders: [k: v] | userAgent: $s, defaultHeaders: [$k => $v] | userAgent = s, defaultHeaders = mapOf(k to v) |
| Timeout | .timeout(Duration) | { timeoutMs } | options.timeout | .timeout(Duration) | lws.WithTimeout(d) | timeout=seconds | Timeout = TimeSpan | timeout: seconds | timeout: $seconds | timeout = 20.seconds |
| Per-call options | ReadOptions / CreateOptions / UpdateOptions / DeleteOptions | { headers, signal, … } | ReadOptions{…} / CreateOptions{…} / … | request-builder methods | variadic CallOptions | keyword arguments | ReadOptions / CreateOptions / UpdateOptions / DeleteOptions | ReadOptions / CreateOptions / UpdateOptions / DeleteOptions | named arguments (slug:, ifMatch:, …, headers:, timeout:) | named arguments (slug =, ifMatch =, …, headers =, timeout =) |
Discovery
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Discover from any URL | discoverStorage(url) | discoverStorage(url) | discover_storage(url) | discover_storage(url) | DiscoverStorage(ctx, url) | discover_storage(url) | DiscoverStorageAsync(url) | discoverStorage(url) | discoverStorage($url) | discoverStorage(url) |
| Fetch description | getStorageDescription(url) | getStorageDescription(url) | get_storage_description(url) | get_storage_description(url) | GetStorageDescription(ctx, url) | get_storage_description(url) | GetStorageDescriptionAsync(url) | getStorageDescription(url) | getStorageDescription($url) | getStorageDescription(url) |
| Storage root | storageRoot() | storageRoot() | storage_root() | storage_root()? | StorageRoot() | storage_root() | GetStorageRoot() | try storageRoot() | storageRoot() | storageRoot() |
| Find services | service(t) / services(t) | service(t) / services(t) | service(t) / services_of(t) | service(t) / services_of(t) | Service(t) / ServicesOfType(t) | service(t) / find_services(t) | GetService(t) / GetServices(t) | service(t) / services(t) | service($t) / services($t) | service(t) / services(t) |
| Well-known services | notificationService() … → Optional<Service> | notificationService() … → Service | undefined | notification_service() … → const Service* | notification_service() … → Option<&Service> | NotificationService() … → (Service, bool) | notification_service() … → endpoint URL | None | NotificationService … → Service? | notificationService … → Service? | notificationService() … → ?Service | notificationService() … → Service? |
| Capability | capability(t) | capability(t) | capability(t) | capability(t) | Capability(t) | capability(t) | GetCapability(t) | capability(t) | capability($t) | capability(t) |
| Move capability | moveCapability() → Optional<MoveCapability> | moveCapability() → MoveCapability | undefined | move_capability() → std::optional<MoveCapability> | move_capability() → Option<MoveCapability> | MoveCapability() → (MoveCapability, bool) | move_capability() → MoveCapability | None | MoveCapability → MoveCapability? | moveCapability → MoveCapability? | moveCapability() → ?MoveCapability | moveCapability() → MoveCapability? |
Reading
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Metadata only | head(url) | head(url) | head(url) | head(url) | Head(ctx, url) | head(url) | HeadAsync(url) | head(url) | head($url) | head(url) |
| Read | read(url, ReadOptions) | read(url, { … }) | read(url, ReadOptions{…}) | read(url).… | Read(ctx, url, opts...) | read(url, …) | ReadAsync(url, ReadOptions) | read(url, options: ReadOptions) | read($url, accept:, range:, ifNoneMatch:, …) | read(url, accept =, range =, ifNoneMatch =, …) |
| Body | text() / body() / json() / json(Class) | text() / bytes() / json() / blob() | text() / body / json() | text()? / body / json::<T>()? | Text() / Body / JSON(&v) | text / content / json() | GetText() / Body / GetJson() / GetJson<T>() | text / body / json() / decode(T.self) | text() / body / json() | text() / bytes / json() / decode<T>() |
| Stream body | readStream(url) → ResourceStream | read(url).body (ReadableStream) | — (use byte ranges) | read(url).send_streaming() | ReadStream(ctx, url) | stream(url) (context manager) | ReadStreamAsync(url) → ResourceStream | — (bodies are Data) | — (bodies are strings) | — (bodies are ByteArrays) |
| Conditional read | ReadOptions.ifNoneMatch(etag) | { ifNoneMatch } | {.if_none_match = …} | .if_none_match(etag) | lws.IfNoneMatch(etag) | if_none_match= | new ReadOptions { IfNoneMatch = etag } | ReadOptions(ifNoneMatch: etag) | read($url, ifNoneMatch: $etag) | read(url, ifNoneMatch = etag) |
| 304 result | notModified() | notModified | not_modified | not_modified | NotModified | not_modified | NotModified | notModified | notModified | notModified |
| Byte range | range(start, end) / suffixRange(n) | { range: { start, end } | { suffix } } | byte_range(first, last) | .range(start, Some(end)) | lws.ByteRange(start, end) | range=(start, end) | Range = new RangeHeaderValue(from, to) | .bytes(a...b) / .from(a) / .suffix(n) | ByteRange::of($a, $b) / ::from($a) / ::last($n) | ByteRange.of(a, b) / .from(a) / .last(n) |
| Read a container page | readContainer(url) | readContainer(url) | read_container(url) | read_container(url) | ReadContainer(ctx, url) | read_container(url) | ReadContainerAsync(url) | readContainer(url) | readContainer($url) | readContainer(url) |
| Iterate all members | listContainer(url) → Stream | listContainer(url) → AsyncGenerator | list_container(url) → ContainerRange | list_container(url) → LwsStream | ListContainer(ctx, url) → iter.Seq2 | list_container(url) → Iterator | ListContainerAsync(url) → IAsyncEnumerable | listContainer(url) → PagedSequence (AsyncSequence) | listContainer($url) → PagedSequence (foreach) | listContainer(url) → Flow<ContainedResource> |
Writing
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Create | create(url, Body, type, CreateOptions) | create(url, body, type, { … }) | create(url, body, type, {…}) | create(url, body, type).… | Create(ctx, url, io.Reader, type, opts...) | create(url, body, type, …) | CreateAsync(url, bytes | Stream, type, CreateOptions) | create(in: url, body: Data, contentType:, options:) | create($url, $body, $type, slug:, types:, links:) | create(url, ByteArray, type, slug =, types =, links =) |
| Create JSON / text | createJson(url, value, opts) | createJson / createText | create_json(url, json, opts) | create_json(url, &value) | CreateJSON(ctx, url, v, opts...) | create_json / create_text | CreateJsonAsync / CreateTextAsync | createJSON(in:json:) / createJSON(in:value:) / createText(in:text:) | createJson($url, $value) / createText($url, $text) | createJson(url, JsonElement) / createText(url, text) |
| Create container | createContainer(url, opts) | createContainer(url, opts) | create_container(url, opts) | create_container(url) | CreateContainer(ctx, url, opts...) | create_container(url, …) | CreateContainerAsync(url, opts) | createContainer(in: url, options:) | createContainer($url, slug:) | createContainer(url, slug =) |
| Slug / types / links | CreateOptions.builder().slug().type().link() | { slug, types, links } | {.slug, .types, .links} | .slug() .resource_type() .link() | lws.Slug() lws.Types() lws.Links() | slug=, types=, links= | new CreateOptions { Slug, Types, Links } | CreateOptions(slug:, links:, types:) | slug: $s, types: […], links: […] | slug = s, types = listOf(…), links = listOf(…) |
| Replace (PUT) | update(url, Body, type, UpdateOptions) | update(url, body, type, { … }) | update(url, body, type, {…}) | update(url, body, type).… | Update(ctx, url, r, type, opts...) | update(url, body, type, …) | UpdateAsync(url, bytes | Stream, type, UpdateOptions) | update(url, body: Data, contentType:, options:) | update($url, $body, $type, ifMatch:, …) | update(url, ByteArray, type, ifMatch =, …) / updateText / updateJson |
| If-Match | UpdateOptions.ifMatch(etag) | { ifMatch } | {.if_match = …} | .if_match(etag) | lws.IfMatch(etag) | if_match= | new UpdateOptions { IfMatch = etag } | UpdateOptions(ifMatch: etag) | ifMatch: $etag | ifMatch = etag |
| Prefer: set-linkset | builder().setLinkset(true).link(…) | { setLinkset: true, links } | {.links, .set_linkset = true} | .set_linkset(true).link(…) | lws.SetLinkset() lws.Links(…) | set_linkset=True, links= | { SetLinkset = true, Links = […] } | UpdateOptions(links: […], setLinkset: true) | update(…, links: […], setLinkset: true) | update(…, links = listOf(…), setLinkset = true) |
| JSON Patch | patch(url, JsonPatch, opts) | patch(url, JsonPatch | ops) | patch(url, JsonPatch, opts) | patch(url, &JsonPatch) | Patch(ctx, url, JSONPatch, opts...) | patch(url, JsonPatch) | PatchAsync(url, JsonPatch, opts) | patch(url, patch: JSONPatch, options:) | patch($url, JsonPatch, ifMatch:) | patch(url, JsonPatch, ifMatch =) |
| Other patch format | patch(url, Body, type, opts) | patch(url, { body, contentType }) | patch(url, body, type, opts) | patch_with(url, body, type) | PatchRaw(ctx, url, r, type) | patch(url, body, content_type=) | PatchAsync(url, bytes, type, opts) | patch(url, body: Data, contentType:) | patch($url, $body, $contentType) | patch(url, ByteArray, contentType) |
| Patch builder | JsonPatch.builder().add().remove()….build() | new JsonPatch().add().remove()… | lws::JsonPatch{}.add().remove()… | JsonPatch::new().add().remove()… (move_value) | lws.JSONPatch{}.Add().Remove()… | JsonPatch().add().remove()… | new JsonPatch().Add().Remove()… (immutable) | JSONPatch().add().remove()… (a value; move(from:to:)) | (new JsonPatch())->add()->remove()… (fluent) | jsonPatch { add(); remove() … } / JsonPatch().add().remove()… |
| JSON Pointer | JsonPointer.of(segments...) | JsonPointer.from([segments]) | JsonPointer::from_segments({…}) | JsonPointer::from_segments([…]) | lws.JSONPointer(segments...) | JsonPointer.from_segments(*segments) | JsonPointer.Of(segments...) | JSONPointer.from(segments...) | JsonPointer::fromSegments(...$segments) | JsonPointer.fromSegments(vararg segments) |
| Delete | delete(url, DeleteOptions) | delete(url, { … }) | remove(url, {…}) | delete(url).… | Delete(ctx, url, opts...) | delete(url, …) | DeleteAsync(url, DeleteOptions) | delete(url, options: DeleteOptions) | delete($url, ifMatch:) | delete(url, ifMatch =) |
| Recursive delete | DeleteOptions.recursive() | { recursive: true } | {.recursive = true} | .recursive(true) | lws.Recursive() | recursive=True | new DeleteOptions { Recursive = true } | DeleteOptions(recursive: true) | delete($url, recursive: true) | delete(url, recursive = true) |
Metadata (linksets)
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Linkset URL | linksetUrl(url) | linksetUrl(url) | linkset_url(url) | linkset_url(url) | LinksetURL(ctx, url) | linkset_url(url) | LinksetUrlAsync(url) | linksetURL(url) | linksetUrl($url) | linksetUrl(url) |
| Read for a resource | readLinkset(url) | readLinkset(url) | read_linkset(url) | read_linkset(url) | ReadLinkset(ctx, url) | read_linkset(url) | ReadLinksetAsync(url) | readLinkset(url) | readLinkset($url) | readLinkset(url) |
| Read by linkset URL | readLinksetResource(url) | — | — | read_linkset_document(url) | ReadLinksetAt(ctx, url) | read_linkset_at(url) | ReadLinksetResourceAsync(url) | readLinksetResource(url) | readLinksetResource($url) | readLinksetResource(url) |
| Replace (PUT) | updateLinkset(url, Linkset, opts) | updateLinkset(url, linkset, opts) | update_linkset(url, linkset, opts) | update_linkset(url, &linkset) | UpdateLinkset(ctx, url, *Linkset, opts...) | update_linkset(url, linkset, …) | UpdateLinksetAsync(url, Linkset, opts) | updateLinkset(url, linkset:, options:) | updateLinkset($url, Linkset, ifMatch:) | updateLinkset(url, Linkset, ifMatch =) |
| Patch | patchLinkset(url, JsonPatch, opts) | patchLinkset(url, patch, opts) | patch_linkset(url, patch, opts) | patch_linkset(url, &patch) | PatchLinkset(ctx, url, patch, opts...) | patch_linkset(url, patch, …) | PatchLinksetAsync(url, JsonPatch, opts) | patchLinkset(url, patch:, options:) | patchLinkset($url, JsonPatch, ifMatch:) | patchLinkset(url, JsonPatch, ifMatch =) |
| Model helpers | links() targets(rel) add(…) remove(…) (immutable) | links() targets(rel) add() remove() clone() | links() targets(rel) add() remove() | links() targets(rel) add() remove() | Links() Targets(rel) Add() Remove() | links() targets(rel) add() remove() copy() | GetLinks() GetTargets(rel) Add(…) Remove(…) (immutable) | links targets(rel) adding(…) removing(…) (a value) | links() targets($rel) hrefs($rel) add(…) remove(…) (in place) | links() targets(rel) hrefs(rel) add(…) remove(…) (in place) |
Moving resources
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| What moves | movesDataResources() / movesContainers() | movesDataResources() / movesContainers() | moves_data_resources() / moves_containers() | moves_data_resources() / moves_containers() | MovesDataResources() / MovesContainers() | moves_data_resources / moves_containers | MovesDataResources / MovesContainers | movesDataResources / movesContainers | movesDataResources() / movesContainers() | movesDataResources / movesContainers |
| Capability as described | appliesTo() / preservesIdentifier() → Optional<Boolean> | appliesTo / preservesIdentifier → boolean | undefined | applies_to / preserves_identifier → std::optional<bool> | applies_to / preserves_identifier → Option<bool> | AppliesTo / PreservesIdentifier → *bool | applies_to / preserves_identifier → bool | None | AppliesTo / PreservesIdentifier → bool? | appliesTo / preservesIdentifier → Bool? | appliesTo / preservesIdentifier → ?bool | appliesTo / preservesIdentifier → Boolean? |
| Move | move(url, destination, MoveOptions) / moveAsync(…) | move(url, destination, { … }) | move(url, destination, MoveOptions{…}) | move_resource(url, destination).… | Move(ctx, url, destination, opts...) | move(url, destination, …) | MoveAsync(url, destination, MoveOptions) | move(url, to: destination, options: MoveOptions) | move($url, $destination, ifMatch:) | move(url, destination, ifMatch =) |
| If-Match (default: the linkset's ETag) | MoveOptions.ifMatch(etag) | { ifMatch } | {.if_match = …} | .if_match(etag) | lws.IfMatch(etag) | if_match= | new MoveOptions { IfMatch = etag } | MoveOptions(ifMatch: etag) | ifMatch: $etag | ifMatch = etag |
| Where it is now | location() / linkset() | location / linkset | location / linkset | location / linkset | Location / Linkset | location / linkset | Location / Linkset | location / linkset | location / linkset | location / linkset |
| Identifier kept | identifierPreserved() | identifierPreserved | identifier_preserved | identifier_preserved | IdentifierPreserved | identifier_preserved | IdentifierPreserved | identifierPreserved | identifierPreserved | identifierPreserved |
Authentication
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Authenticator interface | Authenticator (authorize, handleChallenge) | Authenticator (authorize, handleChallenge) | lws::Authenticator (authorize, handle_challenge) | Authenticator trait (BoxFuture methods) | Authenticator (Authorize, HandleChallenge) | Authenticator (authorize, handle_challenge) | IAuthenticator (AuthorizeAsync, HandleChallengeAsync) | Authenticator protocol (authorize, handleChallenge) | Authenticator (authorize, handleChallenge) | Authenticator (suspend authorize, handleChallenge) |
| Token exchange | TokenExchangeAuthenticator.of(c) / .builder(c) | new TokenExchangeAuthenticator(c, opts) | TokenExchangeAuthenticator(c, TokenExchangeOptions) | TokenExchangeAuthenticator::new(c) / ::builder(c) | NewTokenExchangeAuthenticator(c, *TokenExchangeOptions) | TokenExchangeAuthenticator(c, …) | new TokenExchangeAuthenticator(c, TokenExchangeOptions) | TokenExchangeAuthenticator(credentials: c, options:) (an actor) | new TokenExchangeAuthenticator($c, allowInsecureHttp:, …) | TokenExchangeAuthenticator(c, allowInsecureHttp =, …) |
| Authorization server filter | .authorizationServerFilter((issuer, storage) -> …) | { authorizationServerFilter: (issuer, storage) => … } | authorization_server_filter = [](issuer, storage) { … } | .authorization_server_filter(|issuer, storage| …) | AuthorizationServerFilter: func(issuer, storage string) bool | authorization_server_filter=lambda issuer, storage: … | AuthorizationServerFilter = (issuer, storage) => … | authorizationServerFilter: { issuer, storage in … } | authorizationServerFilter: fn ($issuer, $storage) => … | authorizationServerFilter = { issuer, storage -> … } |
| Protected resource metadata (RFC 9728) | ProtectedResourceMetadata.parse(json) | ProtectedResourceMetadata.parse(json) | ProtectedResourceMetadata::from_json(json) | ProtectedResourceMetadata::from_json(value)? | ParseProtectedResourceMetadata(data) | ProtectedResourceMetadata.from_json(data) | ProtectedResourceMetadata.Parse(json) | try ProtectedResourceMetadata.parse(json) | ProtectedResourceMetadata::parse($json) | ProtectedResourceMetadata.parse(json) |
| Credential provider context | CredentialContext(issuer, storage, metadata) | CredentialContext { issuer, storage, metadata, signal } | CredentialContext{issuer, storage, metadata} | CredentialContext { issuer, storage, metadata } | CredentialContext{Issuer, Storage, Metadata} | CredentialContext(issuer, storage, metadata) | CredentialContext(Issuer, Storage, Metadata) | CredentialContext(issuer, storage, metadata) | CredentialContext($issuer, $storage, $metadata) | CredentialContext(issuer, storage, metadata) |
| Static bearer token | BearerTokenAuthenticator.of(token, realm) | new BearerTokenAuthenticator(token, { realm }) | BearerTokenAuthenticator(token, realm) | BearerTokenAuthenticator::new(t).with_realm(u) | NewBearerTokenAuthenticator(token, realm) | BearerTokenAuthenticator(token, realm=) | new BearerTokenAuthenticator(token, realm) | BearerTokenAuthenticator(token:, realm:) | new BearerTokenAuthenticator($token, realm:) | BearerTokenAuthenticator(token, realm =) |
| OpenID Connect | OpenIdCredentials.of(t) / .from(supplier) | new OpenIdCredentials(t | fn) | OpenIdCredentials(t | supplier) | OpenIdCredentials::new(t) / ::from_fn(f) | NewOpenIDCredentials(t) / NewOpenIDCredentialsFunc(f) | OpenIdCredentials(t | callable) | new OpenIdCredentials(t | callback) | OpenIDCredentials(idToken:) / (idTokens: closure) | new OpenIdCredentials($t | fn) | OpenIdCredentials(t) / OpenIdCredentials { context -> … } |
| SAML 2.0 | SamlCredentials.ofXml(xml) / .ofEncoded(b64) | new SamlCredentials(assertion | fn) | SamlCredentials::from_xml(xml) / SamlCredentials(b64) | SamlCredentials::from_xml(xml) / ::new(b64) | NewSAMLCredentials(EncodeSAMLAssertion(xml)) | SamlCredentials(xml | b64 | callable) | SamlCredentials.FromXml(xml) / .FromEncoded(b64) | SAMLCredentials.fromXML(xml) / .fromEncoded(b64) | SamlCredentials::fromXml($xml) / ::fromEncoded($b64) | SamlCredentials.fromXml(xml) / .fromEncoded(b64) |
| Self-signed did:key | SelfSignedCredentials.didKey(KeyPair) | SelfSignedCredentials.didKey(pair) | SelfSignedCredentials::did_key(PrivateKey) | SelfSignedCredentials::did_key(SigningKey) | NewDIDKeyCredentials(signer, opts) | SelfSignedCredentials.did_key(SigningKey) | SelfSignedCredentials.DidKey(SigningKey) | SelfSignedCredentials.didKey(SigningKey) | SelfSignedCredentials::didKey(SigningKey) | SelfSignedCredentials.didKey(SigningKey) |
| Self-signed HTTPS agent | SelfSignedCredentials.forAgent(uri, key, kid) | SelfSignedCredentials.forAgent(agent, pair, kid) | SelfSignedCredentials::for_agent(uri, key, kid) | SelfSignedCredentials::for_agent(agent, key, kid) | NewSelfSignedCredentials(agent, signer, kid, opts) | SelfSignedCredentials.for_agent(agent, key, kid) | SelfSignedCredentials.ForAgent(uri, key, kid) | SelfSignedCredentials.forAgent(url, key:, keyID:) | SelfSignedCredentials::forAgent($agent, $key, $kid) | SelfSignedCredentials.forAgent(agent, key, kid) |
| Generate keys | KeyPairs.generateP256() / generateEd25519() | generateKeyPair("ES256" | "EdDSA") | PrivateKey::generate(KeyAlgorithm::ES256 | EdDSA) | SigningKey::generate_p256() / generate_ed25519() | GenerateP256Key() / GenerateEd25519Key() | SigningKey.generate("ES256" | "EdDSA") | SigningKey.GenerateP256() / GenerateEd25519() | SigningKey.generateP256() / generateEd25519() | SigningKey::generateP256() / generateEd25519() | SigningKey.generateP256() / generateEd25519() |
| Export / import JWK | Jwk.fromKeyPair / Jwk.toPrivateKey | exportPrivateJwk / importKeyPair | private_jwk() / PrivateKey::from_jwk | to_jwk() / SigningKey::from_jwk | JWKFromPrivateKey / ParseJWK(…).PrivateKey() | private_jwk() / SigningKey.from_jwk | key.ToJwk() / SigningKey.FromJwk | key.jwk / SigningKey(jwk:) | $key->jwk() / SigningKey::fromJwk($jwk) | key.jwk() / SigningKey.fromJwk(jwk) |
| did:key ⇄ key | DidKey.fromPublicKey / DidKey.toPublicKey | didKeyFromJwk / jwkFromDidKey | did_key_from_public_jwk | key.did_key() / VerifyingKey::from_did_key | DIDKeyFromPublicKey / PublicKeyFromDIDKey | did_key_from_jwk / did_key_to_jwk | DidKey.FromPublicKey / DidKey.ToPublicKey | DIDKey.did(for:) / DIDKey.publicKey(did) | DidKey::did($publicKey) / DidKey::publicKey($did) | DidKey.did(publicKey) / DidKey.publicKey(did) |
| CID document | ControlledIdentifiers.document(…) | controlledIdentifierDocument(…) | controlled_identifier_document(…) | crypto::controlled_identifier_document(…) | NewControlledIdentifierDocument(…) | controlled_identifier_document(…) | ControlledIdentifierDocument.Create(…) | ControlledIdentifierDocument.create(…) | ControlledIdentifierDocument::create(…) | ControlledIdentifierDocument.create(…) |
Notifications
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Subscribe | subscribe(url | StorageDescription, WebhookSubscriptionRequest) | subscribe(service, { topics, inbox, expires }) | subscribe(url | StorageDescription, WebhookSubscriptionRequest) | subscribe(url, &req) / subscribe_storage(&sd, &req) | Subscribe(ctx, url, req) / SubscribeWebhook(ctx, sd, req) | subscribe(service, topics, inbox, expires=) | SubscribeAsync(url | Service, WebhookSubscriptionRequest) | subscribe(url | Service, request: WebhookSubscriptionRequest) | subscribe($url | Service, WebhookSubscriptionRequest) | subscribe(url | Service, WebhookSubscriptionRequest) |
| List / get / cancel | listSubscriptions / getSubscription / unsubscribe | listSubscriptions / getSubscription / unsubscribe | list_subscriptions / get_subscription / unsubscribe | list_subscriptions / get_subscription / unsubscribe | ListSubscriptions / GetSubscription / Unsubscribe | list_subscriptions / get_subscription / unsubscribe | ListSubscriptionsAsync / GetSubscriptionAsync / UnsubscribeAsync | listSubscriptions / getSubscription / unsubscribe | listSubscriptions / getSubscription / unsubscribe | listSubscriptions / getSubscription / unsubscribe |
| Parse a notification | Notification.parse(json) | parseNotification(body) | parse_notification(body) | parse_notification(bytes) | ParseNotification(data) | parse_notification(body) | Notification.Parse(json) | Notification.parse(data | json) | Notification::parse($body | $json) | Notification.parse(bytes | text | json) |
| Verify deliveries | WebhookVerifier.builder()…build().verify(m, inbox, headers, body) | new WebhookVerifier({…}).verify(request, { inboxUrl }) | WebhookVerifier(client, opts).verify(m, url, headers, body) | WebhookVerifier::builder()…build().verify(…).await | NewWebhookVerifier(opts).Verify / VerifyRequest / Handler | WebhookVerifier(client=…).verify(…) / AsyncWebhookVerifier | new WebhookVerifier(opts).VerifyAsync(m, inbox, headers, body) | WebhookVerifier(options:).verify(method:url:headers:body:) | (new WebhookVerifier(…))->verify($m, $inbox, $headers, $body) / verifyGlobals($inbox) | WebhookVerifier(client, …).verify(m, inbox, headers, body) / verifyExchange(exchange, inbox) |
Access requests and grants
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Request access | requestAccess(url, AccessRequest) | requestAccess(service, request) | request_access(url, AccessRequest) | request_access(url, &request) | RequestAccess(ctx, url, *AccessRequest) | request_access(service, request) | RequestAccessAsync(url, AccessRequest) | requestAccess(url, request: AccessRequest) | requestAccess($url, AccessRequest) | requestAccess(url, AccessRequest) |
| List / get / cancel | listAccessRequests / getAccessRequest / cancelAccessRequest | listAccessRequests / getAccessRequest / cancelAccessRequest | list_access_requests / get_access_request / cancel_access_request | list_access_requests / get_access_request / cancel_access_request | ListAccessRequests / GetAccessRequest / CancelAccessRequest | list_access_requests / get_access_request / cancel_access_request | ListAccessRequestsAsync / GetAccessRequestAsync / CancelAccessRequestAsync | listAccessRequests / getAccessRequest / cancelAccessRequest | listAccessRequests / getAccessRequest / cancelAccessRequest | listAccessRequests / getAccessRequest / cancelAccessRequest |
| Grant / list / get / revoke | grantAccess / listAccessGrants / getAccessGrant / revokeAccessGrant | grantAccess / listAccessGrants / getAccessGrant / revokeAccessGrant | grant_access / list_access_grants / get_access_grant / revoke_access_grant | grant_access / list_access_grants / get_access_grant / revoke_access_grant | GrantAccess / ListAccessGrants / GetAccessGrant / RevokeAccessGrant | grant_access / list_access_grants / get_access_grant / revoke_access_grant | GrantAccessAsync / ListAccessGrantsAsync / GetAccessGrantAsync / RevokeAccessGrantAsync | grantAccess / listAccessGrants / getAccessGrant / revokeAccessGrant | grantAccess / listAccessGrants / getAccessGrant / revokeAccessGrant | grantAccess / listAccessGrants / getAccessGrant / revokeAccessGrant |
| Build a request | AccessRequest.builder().storage().access(policy) | new AccessRequest({ storage, access }) | AccessRequest{.storage, .access} | AccessRequest::builder(storage).policy(p).build()? | NewAccessRequest(storage, policies...) | AccessRequest(storage=, access=[…]) | new AccessRequest(storage, [policy], inbox) | AccessRequest(storage:, access: [policy], inbox:) | AccessRequest::create($storage, [$policy], $inbox) | AccessRequest(storage, listOf(policy), inbox) |
| Build a policy | AccessPolicy.builder().actions().assignee().target() | { actions, assignee, target, constraints } | AccessPolicy{.actions, .assignee, .target} | AccessPolicy::builder(assignee).action().target_resources() | NewAccessPolicy(assignee, actions...).WithTarget() | AccessPolicy(actions=, assignee=, target=) | new AccessPolicy(actions, assignee, target, constraints) | AccessPolicy(actions:, assignee:, target:, constraints:) | new AccessPolicy($actions, $assignee, $target, $constraints) | AccessPolicy(actions, assignee, target, constraints) |
| Constraints | Constraint.purpose / client / format / type / notBefore / notAfter | Constraints.purpose / client / format / type / notBefore / notAfter | Constraint::purpose / client / format / type / not_before / not_after | Constraint::purpose / client / format / resource_type / not_before / not_after | PurposeConstraint / ClientConstraint / FormatConstraint / TypeConstraint / NotBefore / NotAfter | Constraint.purpose / client / format / resource_type / not_before / not_after | Constraint.Purpose / Client / Format / Type / NotBefore / NotAfter | Constraint.purpose / client / format / type / notBefore / notAfter | Constraint::purpose / client / format / type / notBefore / notAfter | Constraint.purpose / client / format / type / notBefore / notAfter |
Type index and search
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Read an index page | readTypeIndex(url) | readTypeIndex(url) | read_type_index(url) | read_type_index(url) | ReadTypeIndex(ctx, url) | read_type_index(url) | ReadTypeIndexAsync(url) | readTypeIndex(url) | readTypeIndex($url) | readTypeIndex(url) |
| Iterate all types | listTypes(url) → Stream<String> | listTypes(service) → AsyncGenerator<string> | list_types(url) → TypeRange | list_types(url) → LwsStream<String> | ListTypes(ctx, url) → iter.Seq2[string, error] | list_types(service) → Iterator[str] | ListTypesAsync(url) → IAsyncEnumerable<string> | listTypes(url) → PagedSequence<String> | listTypes($url) → PagedSequence<string> | listTypes(url) → Flow<String> |
| Search (one page, QUERY) | searchTypes(url, TypeQuery) | searchTypes(service, query) | search_types(url, query) | search_types(url, &query) | SearchTypes(ctx, url, *TypeQuery) | search_types(service, query) | SearchTypesAsync(url, TypeQuery) | searchTypes(url, query: TypeQuery) | searchTypes($url, TypeQuery) | searchTypes(url, TypeQuery) |
| Search (all pages) | searchAll(url, query) | searchAll(service, query) | search_all(url, query) | search_all(url, &query) | SearchAll(ctx, url, q) | search_all(service, query) | SearchAllAsync(url, query) | searchAll(url, query:) | searchAll($url, $query) | searchAll(url, query) |
| Query builder | TypeQuery.builder().allOf().anyOf().relationAllOf() | new TypeQuery().allOf().anyOf().relation(r).allOf() | TypeQuery{}.all_of({…}).any_of({…}).relation_all_of(r, {…}) | TypeQuery::new().all_of([…]).any_of([…]).relation(r).all_of([…]) | NewTypeQuery().AllOf().AnyOf().RelationAllOf(r, …) | TypeQuery().all_of().any_of().relation(r).all_of() | new TypeQuery().AllOf().AnyOf().Relation(r).AllOf() | try TypeQuery().allOf().anyOf().relation(r).allOf() | TypeQuery::create()->allOf()->anyOf()->relation($r)->allOf() | TypeQuery().allOf().anyOf().relation(r).allOf() |
| Accepted formats | acceptedQueryFormats(url) | acceptedQueryFormats(service) | accepted_query_formats(url) | accepted_query_formats(url) | AcceptedQueryFormats(ctx, url) | accepted_query_formats(service) | AcceptedQueryFormatsAsync(url) | acceptedQueryFormats(url) | acceptedQueryFormats($url) | acceptedQueryFormats(url) |
HTTP primitives
| Concept | Java | TypeScript | C++ | Rust | Go | Python | C# | Swift | PHP | Kotlin |
|---|---|---|---|---|---|---|---|---|---|---|
| Link header (RFC 8288) | LinkHeader.parse / LinkHeader.format | parseLinkHeader / formatLink | parse_link_header / Link::to_header | headers::parse_link_headers | ParseLinkHeader / FormatLinks | parse_link_header / serialize_links | LinkHeader.Parse / LinkHeader.Format | LinkHeader.parse / LinkHeader.format | LinkHeader::parse / LinkHeader::format | LinkHeader.parse / LinkHeader.format |
| WWW-Authenticate | WwwAuthenticate.parse | parseWwwAuthenticate | parse_www_authenticate | headers::parse_www_authenticate | ParseChallenges | parse_www_authenticate | WwwAuthenticate.Parse | WWWAuthenticate.parse | WwwAuthenticate::parse | WwwAuthenticate.parse |
| Structured fields (RFC 8941) | StructuredFields.parseDictionary | parseDictionary / serializeDictionary | sf::parse_dictionary / sf::serialize | headers::structured | ParseSFDictionary | structured_fields module | StructuredFields.ParseDictionary / SerializeDictionary | StructuredFields.parseDictionary / serialize | StructuredFields::parseDictionary / serializeDictionary | StructuredFields.parseDictionary / serializeDictionary |
| Problem details (RFC 9457) | ProblemDetails | parseProblemDetails | ProblemDetails::from_response | headers::ProblemDetails | ParseProblemDetails | ProblemDetails | ProblemDetails.Parse / FromJson | ProblemDetails.parse / init(json:) | ProblemDetails::parse / $e->problem | ProblemDetails.parse / e.problem |
| Constants | Lws.Rel / Lws.Type / Lws.MediaType / … | Rel / LwsType / MediaType / ServiceType / … | lws::rel / types / media / service / … | constants::{rel, types, media_type, …} | RelStorage / TypeContainer / MediaLWSJSON / … | Rel / Types / MediaType / ServiceType / … | Lws.Rel / Lws.Types / Lws.MediaType / Lws.ServiceType / … | LinkRelation / ResourceType / MediaType / ServiceType / … | LinkRelation::… / ResourceType::… / MediaType::… / ServiceType::… | LinkRelation.… / ResourceType.… / MediaType.… / ServiceType.… |
Where names differ Keywords and built-ins force a few renames. C++ uses remove (not delete) and Constraint::op. Rust uses Client::move_resource, JsonPatch::move_value and Constraint::resource_type. Python uses NotImplementedByServerError, links_for and find_services. Java uses LwsProtocolException and HttpStatusException. C# uses HttpNotImplementedException, Subscription.Url and GetStorageRoot(). Swift uses LWSError.protocolError, upper-case acronyms (LWSClient, JSONPatch, DIDKey, linksetURL) and the label in: for the container of a create. PHP uses ReadResult for the contract's Resource (resource is soft-reserved), …Exception class names, Link::typeLink() and Subscription::$url. Kotlin uses the package com.ebremer.lws.kotlin, …Exception class names in one sealed hierarchy, Link.typeLink(), Subscription.url and activity.`object` (object is a keyword). Each language guide lists its deviations.