首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我的.Net Core 3.1的Tus URL不工作,我的配置是否正确?

我的.Net Core 3.1的Tus URL不工作,我的配置是否正确?
EN

Stack Overflow用户
提问于 2020-12-08 00:38:05
回答 1查看 211关注 0票数 0

当我向Startup类中指定的URL路径发送请求时,我得到了404 not found当使用Post请求时,我使用的是Postman。当我使用Postman发送options请求时,我遇到了Startup类中的代码块,并得到了204No Content。

我在这里做错了什么?我已经访问了to的.NET示例,并通过chrome dev工具查看了他们的网络请求,我的请求似乎是相同的?!我正在使用.NET core 3.1

启动类,配置方法。

代码语言:javascript
复制
    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        app.UseCors(builder => builder
           .AllowAnyHeader()
           .AllowAnyMethod()
           .AllowAnyOrigin()
           .WithExposedHeaders(tusdotnet.Helpers.CorsHelper.GetExposedHeaders())
        );

        app.UseTus(httpContext => new DefaultTusConfiguration
        {
            // c:\tusfiles is where to store files
            Store = new TusDiskStore(@"C:\tusfiles\"),
            // On what url should we listen for uploads?
            UrlPath = "/files",
            Events = new Events
            {
                OnFileCompleteAsync = async eventContext =>
                {
                    ITusFile file = await eventContext.GetFileAsync();
                    Console.WriteLine(file);
                }
            }
        });
    }

EN

回答 1

Stack Overflow用户

发布于 2020-12-08 02:18:30

因此,您似乎无法通过Postman发出这种类型的请求。当我下拉并使用那里的js client lib时,我能够让它工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65185702

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档