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

https://edu.duthanhduoc.com/learn/NodeJs-Super?lessonId=300 #94

Open
utterances-bot opened this issue Feb 7, 2025 · 2 comments
Open

Comments

@utterances-bot
Copy link

Khu vực học tập | Được Edu

Được chỉ cung cấp các khóa học lập trình online chất lượng, nói không với khóa lởm!

https://edu.duthanhduoc.com/learn/NodeJs-Super?lessonId=300

Copy link

Abshoem commented Feb 7, 2025

res.setHeader('Content-Type', 'application/json') cái này tác dụng cụ thể của nó là gì vậy ạ?

@duthanhduoc
Copy link
Contributor

res.setHeader('Content-Type', 'application/json') cái này tác dụng cụ thể của nó là gì vậy ạ?

Để nói cho client biết là định dạng server trả về là kiểu json, từ đó client nó xử lý dễ dàng và hiển thị cho đúng á em.

Vì server nó có thể trả về content type là ảnh, hoặc html, hoặc video,...

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