Skip to content

send_cbor()

send_cbor() is for sending application/cbor responses easily. It runs reply() function under the hood.

static inline void send_cbor(Res *res, int status, const char *body, size_t body_len)
{
reply(res, status, "application/cbor", body, body_len);
}

Example usage:

#include "ecewo.h"
void hello_world(Req *req, Res *res)
{
// ...
// Some codes...
// ...
send_cbor(res, 200, buffer, len);
}

See Using CBOR chapter.