JumpKick.HttpLib/Builder/RequestBuilder.Action.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using JumpKick.HttpLib.Provider;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using JumpKick.HttpLib.Streams;
using System.Threading;
#if NETFX_CORE
using Windows.Storage.Streams;
#endif
namespace JumpKick.HttpLib.Builder
{
public partial class RequestBuilder
{
#region Actions
ActionProvider actionProvider;
Action<WebHeaderCollection, Stream> success;
Action<WebException> fail;
public RequestBuilder OnSuccess(Action<WebHeaderCollection, String> action)
{
this.success = (headers, stream) =>
{
StreamReader reader = new StreamReader(stream);
action(headers, reader.ReadToEnd());
};
return this;
}
public RequestBuilder OnSuccess(Action<String> action)
{
this.success = (headers, stream) =>
{
StreamReader reader = new StreamReader(stream);
action(reader.ReadToEnd());
};
return this;
}
public RequestBuilder OnSuccess(Action<WebHeaderCollection, Stream> action)
{
this.success = action;
return this;
}
#if NETFX_CORE
public RequestBuilder DownloadTo(Windows.Storage.IStorageFile file)
{
this.success = (headers, result) =>
{
long? length = null;
后面还有 128 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。