JumpKick.HttpLib/Builder/RequestBuilder.Body.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using JumpKick.HttpLib.Provider;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JumpKick.HttpLib.Builder
{
    public partial class RequestBuilder
    {
        #region Body
        private BodyProvider bodyProvider;

        public RequestBuilder Upload(NamedFileStream[] files, object parameters, Action<long,long?> onProgressChanged, Action<long> onUploadComplete)
        {
            MultipartBodyProvider bodyProvider = new MultipartBodyProvider();
            bodyProvider.OnCompletedCallback = onUploadComplete;
            bodyProvider.OnProgressChangeCallback = onProgressChanged;
            foreach (NamedFileStream file in files)
            {
                bodyProvider.AddFile(file);
            }

            bodyProvider.SetParameters(parameters);
            return this.Body(bodyProvider);
        }

        public RequestBuilder Upload(NamedFileStream[] files, object parameters)
        {
            return this.Upload(files, parameters,(a,b)=> { }, a=>{ });
        }

        public RequestBuilder Upload(NamedFileStream[] files)
        {
            return this.Upload(files, new { });
        }

        public RequestBuilder Upload(NamedFileStream[] files, Action<long, long?> onProgressChanged)
        {
            return this.Upload(files, new { }, onProgressChanged, a => { });
        }


        public RequestBuilder Form(object body)
        {
            FormBodyProvider bodyProvider = new FormBodyProvider();
            bodyProvider.AddParameters(body);

            return this.Body(bodyProvider);
        }


        public RequestBuilder Form(IDictionary<String, String> body)
        {
            FormBodyProvider bodyProvider = new FormBodyProvider();
            bodyProvider.AddParameters(body);

            return this.Body(bodyProvider);
后面还有 39 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。