内容简介:此项目作者IKende ,github开源地址:此人博客园地址:我基于他的github项目的 samples学习的。反正我崇拜他
此项目作者IKende ,github开源地址: https://github.com/IKende
此人博客园地址: https://www.cnblogs.com/smark/
我基于他的github项目的 samples学习的。反正我崇拜他
自定义返回类型
public object plaintext(IHttpContext context)
{
context.Response.Header[HeaderTypeFactory.DATE] = DateTime.Now.ToUniversalTime().ToString("r");
return new TextResult("Hello, World!");
}
异步处理
[SkipFilter(typeof(JWTFilter))]
public async Task<TextResult> TestTask(IHttpContext context)
{
var result = new TextResult("Hello, World!");
await Task.Delay(1000);
return result;
}
花了1秒后返回结果
其他
[Get(Route = "{name}")]
public Task<String> Hello(string name)
{
string result = $"hello {name} {DateTime.Now}";
return Task.FromResult(result);
}
public async Task<String> Wait()
{
await Task.Delay(2000);
return $"{DateTime.Now}";
}
设置Https访问
"SSL": true,
"CertificateFile": "c:\\ay2019.pfx",
"CertificatePassword": "******",
或者代码中
mApiServer.Options.SSL = true;
mApiServer.Options.CertificateFile = "c:\\ay2019.pfx";
mApiServer.Options.CertificatePassword = "******";
生成 pfx的openssl http://www.ayjs.net/post/183.html
====================www.ayjs.net 杨洋 wpfui.com ayui ay aaronyang=======请不要转载谢谢了。=========
推荐您阅读更多有关于“FastHttpApi,”的文章
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Learning PHP 5
David Sklar / O'Reilly / July, 2004 / $29.95
Learning PHP 5 is the ideal tutorial for graphic designers, bloggers, and other web crafters who want a thorough but non-intimidating way to understand the code that makes web sites dynamic. The book ......一起来看看 《Learning PHP 5》 这本书的介绍吧!