Comments (11)
I am using Windows 10 Pro, Version 21H2, OS Build 19044.2006,
Experience: Windows Feature Experience Pack 120.2212.4180.0.
.NET target framework is net6.0, language version C# 10
(I hope that's what you mean by .NET version)
from genhttp.
Actually, you should be able to just:
public class BookService
{
[ResourceMethod]
public Stream RequestResponse()
{
return File.OpenRead(@"D:\KUTE_ANIME_DESCRIPTION.OBJ");
}
}
from genhttp.
Thanks for the reply!
This is awesome but unfortunately I still get this exception though the file transfer works.
Just ignore it and continue? The file is around 11 mb, it doesn't happen with very small files
from genhttp.
What client do you use to access the service? Plain browser? Have to check the behaviour with large files ...
from genhttp.
Yea just plain browser, using Edge browser right now. I tried it with a Unity application also, but this time the exception was smaller.
from genhttp.
Hm, cannot reproduce the issue with this minimal example:
Host.Create()
.Handler(ServiceResource.From<WS>())
.Defaults()
.Development()
.Console()
.Run();
class WS
{
[ResourceMethod]
public Stream GetResult()
{
return File.OpenRead(@"C:\temp\largefile.mp4");
}
}
Can you show me how you setup your host instance and probably provide some offending test file to me?
from genhttp.
Hey!
It stopped happening with the Unity application (Happened just once), but it happens always with Edge Browser. Though I don't need it to work with Edge so for me this is fine. Also even after the exception, server runs fine.
Here's my setup code. ResourceMethod stuff is exactly the same as your example.
internal class Program
{
static void Main(string[] args)
{
ushort port = 60907;
Console.WriteLine($"Starting server on http://localhost:{port}");
var server = Host.Create();
server.Port(port);
var api = Layout.Create()
.AddService<APIService>("api")
.Add(CorsPolicy.Permissive());
server.Handler(api)
.Defaults()
.Development()
.Console()
.Start();
Console.ReadKey();
Console.WriteLine("Stopped. Good bye!");
}
}
Edit:
File just gets stuck in upload forever but the issue happens with any 15mb+ file but only with Edge browser, doesn't happen when I do a HTTP Get request from Unity 99% of the time.
from genhttp.
Hm, still cannot reproduce this with your bootstrapper. May I ask which operating system (and version) and .NET version you are using?
from genhttp.
Here's a list of "classic" .NET Versions in my PC.
.NET SDK 6.0.109 and 6.0.401 are installed
from genhttp.
Okay, thanks - last question: when you say "Edge", do you mean the Chromium based version of Edge?
from genhttp.
I am still not able to reproduce this behavior. In the sense of backlog grooming I am closing here - feel free to re-open as soon there is new information.
from genhttp.
Related Issues (20)
- Switch Sonar Scanner to Java 17+
- Allow to debug test failures
- Add a framework to embrace the REPR pattern
- Can not load the svg file at browser HOT 3
- Slightly adjust responses without the need of building a response
- Add content type for JavaScript module files (.mjs)
- Fully support the `Set-Cookie` header in all places
- Allow to provide Open API specification
- Print request information to help debugging issues
- Allow simple types to be read from body
- Allow to easily deserialize responses in tests
- Add support for dependency injection
- Add default structured error mapper
- Allow to test web applications HOT 1
- Serialization and deserialization of 'System.Action' instances are not supported. error HOT 24
- Further performance improvements HOT 3
- Reduce parser allocations by testing for known strings
- Limit server side routing to sane scenarios
- Localhost (Windows) issue when using PUT HOT 4
- Parse requests on line-basis
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from genhttp.