Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated documentation #17

Closed
mbp opened this issue Dec 13, 2017 · 3 comments
Closed

Outdated documentation #17

mbp opened this issue Dec 13, 2017 · 3 comments
Assignees

Comments

@mbp
Copy link

mbp commented Dec 13, 2017

HttpListener exists in .NET Core 2 / .NET Standard, so the description that it fills the void is not true.
It does however fill a different purpose in that it does not depend on http.sys on Windows, which can be useful.

Also, the provided sample in README.md does not compile:

image

@cherepets
Copy link
Contributor

cherepets commented Dec 13, 2017

We had WebListener in Core 1 too so there always was an implementation from Microsoft but it was not crossplatform and less extendable.

About the code, I think the correct one would be like

        if (context.Response.Method == HttpMethod.Get)
        { 
                await context.Response.WriteContentAsync("Hello from Server ...");
        }

@mbp
Copy link
Author

mbp commented Dec 13, 2017

You actually also get an error 'HttpListener' is an ambiguous reference between 'System.Net.Http.HttpListener' and 'System.Net.HttpListener

So the first line in the sample must be changed to:

var listener = new System.Net.Http.HttpListener(IPAddress.Parse("127.0.0.1"), 8081);

@StefH StefH self-assigned this Jan 13, 2018
@StefH
Copy link
Owner

StefH commented Jan 13, 2018

updated

@StefH StefH closed this as completed Jan 13, 2018
StefH added a commit that referenced this issue Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants