Different behavior between mg_http_reply() and mg_printf() #2530
-
I am testing some code and would like to understand the difference in behavior in these two calls. If I use If I use Plainly I can use mg_http_reply() as my solution, but I would like to understand what is going on Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please read https://mongoose.ws/documentation/#best-practices Long story short: use Please follow the guidelines in the documentation, examples and tutorials available. |
Beta Was this translation helpful? Give feedback.
Please read https://mongoose.ws/documentation/#best-practices
Long story short: use
mg_http_reply()
or chunked encoding (mg_http_...chunk()
). Those functions setContent-Length
andc->is_resp
for you. If you usemg_printf()
ormg_send()
instead, don't forget to setContent-Length
andc->is_resp
yourselfPlease follow the guidelines in the documentation, examples and tutorials available.