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

Is it possible to return an HTML response? #207

Closed
k-nasa opened this issue May 10, 2019 · 3 comments
Closed

Is it possible to return an HTML response? #207

k-nasa opened this issue May 10, 2019 · 3 comments

Comments

@k-nasa
Copy link
Contributor

k-nasa commented May 10, 2019

Question

How do I implement it to return an HTML response?
I checked about response, but "content-type: text / html"
There is no applicable place in. Also, there is no processing to return HTML in example.
https://github.com/rustasync/tide/blob/7e87e4e0699a3fff4453c8a25d3f8f5fa186fdbb/src/response.rs

However, I think there are many such use cases.

Here is a suggestion, but I think we should implement a response function that returns HTML, and I think it would be nice if there was something to easily change the response header.
And should add an example to return an HTML response

@yoshuawuyts
Copy link
Member

@k-nasa we've talked about HTML templates before, building a module similar to what we're envisioning for authentication and DB connections.

Right now it's possible to create your own HTML responses with a bit of glue code. I made an example of this late last year: https://github.com/yoshuawuyts/playground-html-rust

Hope this is helpful!

@k-nasa
Copy link
Contributor Author

k-nasa commented May 19, 2019

@yoshuawuyts Thanks!
I will try to add an example if this PR is merged.

I wonder what kind of things you are trying to add. Where is the information?

@k-nasa
Copy link
Contributor Author

k-nasa commented Jun 9, 2019

Closed by #267

@k-nasa k-nasa closed this as completed Jun 9, 2019
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