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

New to REST and TinyRest, need help. #1

Closed
Mason32NZ opened this issue Oct 17, 2017 · 3 comments
Closed

New to REST and TinyRest, need help. #1

Mason32NZ opened this issue Oct 17, 2017 · 3 comments

Comments

@Mason32NZ
Copy link

Hi,

Thank your for making this it looks quite simple to use but I fell there is a lack of documentation.
Could you please provide documentation on all the methods available, how to use them, what arguments they take etc. Also does this support authentication in anyway and how could I easily add it to my project?

Looking forward to your reply.

Thanks.

@Mason32NZ
Copy link
Author

Mason32NZ commented Oct 17, 2017

Also, how to you add querys?
(btw, I am making a C# console application)

@rflechner
Copy link
Owner

Hi,

I have to improve this but you can do:

TinyRestServerCSharp.TinyRest.Server()
                .WithLogger(new TinyRestServer.ConsoleLogger())
                .WithHttp()
                .WithPort(8001)
                .WithBasePath("/ApiMocking")
               .OnGetPath("/hello", (request, response) =>
                {
                    var query = request.QueryString.ToDictionary(kv => kv.Key, kv => kv.Value);
                    return "hello " + query["name"];
                })

Then you can do call http://localhost:8001/ApiMocking/hello?name=romain

Concerning authentication, it's not natively managed but you can do something with functions compostion.

@Mason32NZ
Copy link
Author

Awesome! Thank you very much for the quick reply. I will give that a go and am looking forward to using TinyRest. I hope you continue to support TinyRest and maintain and add features when possible! :)

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

2 participants