Yes your code is wrong.
HTTP response consists of 3 parts: reply line, headers, body.
Corresponding mongoose functions are: mg_send_status(), mg_send_header(),
mg_{send|printf}_data

You're mixing headers and body.


On Thu, Jul 31, 2014 at 9:24 AM, <[email protected]> wrote:

>
> Thanks, for the answer, but I'm not solving the problem yet.
>
> I'm writing a mix between html and plain data, first html data, then
> plain, and then html again.
> I tried to return to the previous status but it dosn't work, and even its
> not printing the the data after the mg_send_header.
>
> while (fgets(line, sizeof(line), file)) {
>>
>>             *mg_send_header(conn, "Content-Type", "text/plain");*
>>             mg_printf_data(conn, "%s", line);
>>         }
>>
>
> I tried to define the mg_send_data header one time, and at each print. But
> neither works, i'm done somting wrong?
>
> --
> You received this message because you are subscribed to the Google Groups
> "mongoose-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mongoose-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to