-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Requesting a new "samples/HelloJson" ~ to show how to make a simple [asp.net dnx] json API / server #770
Comments
This issue is being closed because it has not been updated in 3 months. We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate. |
ryanbrandenburg
pushed a commit
that referenced
this issue
Nov 22, 2018
* Revisions to LinkGenerator * PR feedback
ghost
locked as resolved and limited conversation to collaborators
Dec 4, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi
i could use some help with
how to make a simple [asp.net dnx] json API http server in csharp
so i'm reading http:https://docs.asp.net/en/latest/ and looking at
https://github.com/aspnet/Home/tree/dev/samples/latest
and searching the web for some sample code showing how to write a simple JSON api/server that receives and returns json on asp.net dnx
-- but still lack a starting point for such
I have written a json api server in node, python, ps1, and had hopped to be finished writing one in C#, asp.net vnext today. But i cannot do so, because i do not know how to do three simple things in asp.net dnx ...
(1) Receive and return json strings via http
(2) Dynamically load method-X from some project.json/dnx App
(3) Dynamically run some arbitrary C#/dnx code at runtime
so i was thinking that in addition to:
samples/ConsoleApp
samples/HelloMvc
samples/HelloWeb
there also be a:
samples/HelloJson ~ to show how to make a simple json based http api on dnx
in addition to that i would like HelloJson to be able to dynamically require in or import at runtime a consistently named method from some other dnx Startup.cs / project, so that dynamically loaded method can be used to receive, processes, and asynchronously return the received json object after having done some work on it.
I have written the same json api server in a few languages, as an illustration of what i am trying to get working in csharp, i have pasted the powershell version below. As you can see it's all over and done with in less than 60 lines of code, and ideally is quicker to make than writing this post
(i would have preferred to have the same method name in each case but couldn't quite get there in the case of powershell)
hopefully that sort of thing [json APIs] can be done even more succinctly in asp.net vNext in C#, but i am totally unsure of what syntax to use and calls to make. I am hoping someone can whip up a "samples/HelloJson" to guide the way.
thanks
The text was updated successfully, but these errors were encountered: