REST/HTTP Apis
ServiceStack Service , - ServiceStack, ServiceStack, Auth, , ..
REST/HTTP Apis HTTP Utils, ServiceStack.Text, , API .NET HttpWebRequest, :
List<GithubRepo> repos = "https://api.github.com/users/{0}/repos".Fmt(user)
.GetJsonFromUrl()
.FromJson<List<GithubRepo>>();
ServiceStack .NET #
, ServiceStack ?
URL-, ( ), , TRequest.ToUrl(method) ( ),
AccountRequest request = new AccountRequest { UserName = "me" };
request.ToUrl("GET").Print();
, JsonServiceClient, :
var client = new JsonServiceClient("http://example.org");
var response = client.Get(request);
URL- , ServiceStack
ServiceStack , , DTO HTTP-, , , .
:
/api/[xml|json|html|jsv|csv]/[syncreply|asynconeway]/[servicename]
ServiceStack /reply /oneway, :
/api/[xml|json|html|jsv|csv]/[reply|oneway]/[servicename]
, :
client.UseNewPredefinedRoutes = true;