The .NET (C#,F#,VB.NET) JsonServiceClient does use the user defined routes as they’re able to access the .NET metadata attributes, other languages can’t as they are unable the access the same runtime metadata so they’re typically emitted in comments for documentation purposes and use ServiceStack’s pre-defined routes which is enabled by default on all ServiceStack Services which allows for a simpler generic implementation that can invoke any API.
All JsonServiceClient in all languages also offer API methods which accept a string path which can be used to call APIs using your user-defined routes, e.g:
client.get<GetTechnologyResponse>("/technology/ServiceStack")
client.get<GetTechnologyResponse>("https://techstacks.io/technology/Redis")
// https://techstacks.io/technology?Slug=ServiceStack
client.get<GetTechnologyResponse>("/technology", { Slug: "ServiceStack" })
as well as POST Request DTOs to Custom URLs:
client.postToUrl("/custom-path", request, { Slug: "ServiceStack" });
client.putToUrl("http://example.org/custom-path", request);
JS lib also contain some additional APIs which can help generate populated query strings for user defined routes, e.g:
combinePaths("path","to","..","join") //= path/join
createPath("path/{foo}", {foo:1,bar:2}) //= path/1
createUrl("http://host/path/{foo}",{foo:1,bar:2}) //= http://host/path/1?bar=2