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-Lengthandc->is_respfor you. If you usemg_printf()ormg_send()instead, don't forget to setContent-Lengthandc->is_respyourselfPlease follow the guidelines in the documentation, examples and tutorials available.