iccfish / fslib.network Goto Github PK
View Code? Open in Web Editor NEWA strong http client for .NET with high usability
License: Apache License 2.0
A strong http client for .NET with high usability
License: Apache License 2.0
https://github.com/iccfish/fslib.network/blame/master/src/FSLib.Network/Http/HttpClient.cs#L35
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) =>
{
var e = new CertificateValidationEventArgs((HttpWebRequest)sender, sslPolicyErrors, chain, certificate);
}
这里的设置是全局的 我发邮件的时候系统也会调这个 此时sender 是 smtpclient 强制转化就抛异常了 , 建议 用 as 判断null
有计划支持dotnet core么?
cookie 的 name 里含 _ 的话 这个 函数就失效了。。
最新版本 get 的时候 refer ContentType 都设置不了
无法将类型为“System.Net.SyncMemoryStream”的对象强制转换为类型“System.Net.ConnectStream”。
堆栈信息:
在 lambda_method(Closure , Stream )
在 FSLib.Network.Http.SocketInfoProvider.GetRawSocketFromStream(Stream stream)
在 FSLib.Network.Http.ConnectionInfo.SetStream(Boolean isRequest, Stream stream)
在 FSLib.Network.Http.HttpContext.GetResponseCallback(Action getResponseAction)
当服务器返回
Set-Cookie: l_c_kaolaLYABFrz=2fbd2f3dede92e45
就一个name 跟key 不带其他path domain之类的时候
如果请求的网址是 http://www.a.com/1/2/3?x=s
类库就把这个 cookie的 path 当做 “/1/2/3” 来处理了 而浏览器是当 "/"来处理
相同情况下 var ctx = client.Post("url","string");
await ctx.SendAsync(); 报错 MissingManifestResourceException
ctx.send();就好的。。
好像在博客里说到设计是 考虑 不抛异常 用 ctx.IsValid() 来判断
请求成功,但是IsSuccess值为false。debug发现,发生Exception:“Unable to find a constructor to use for type FSLib.Network.Http.RequestJsonContent. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'Version', line 1, position 11.”
我是想 在 发出请求前, 加个 协议头 对 post的内容进行 签名, 但如果 post的是一个对象 beforerequest 事件里 获取到的还是一个对象。。 不是字符串或者说byte[] 无法签名,请问这个可以做到吗, 同样 服务端返回的时候也要做这个这样的校验
好像.net自身对这个cookie 的处理上又有bug,网上也没什么好的解决方法,搜了 stackoverflow 几乎也都相同的解决方法,解析回来的cookie还跟原来的不一样。不知道鱼儿能解决这问题么
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.