RESTinio 0.4.7 Released!


Minor update for RESTinio with mostly usability enhancements.

What's new:

  • Add support for header fields in `Provisional Message Header Field Names` (см.
    Before 0.4.7:
    resp.append_header( "Access-Control-Allow-Origin", "*" );
    Since 0.4.7:
    resp.append_header( restinio::http_field_t::access_control_allow_origin, "*" )
  • Introduce safer interface with setters and getters for ``http_header_field_t``. This involves a little incompatibility with prior versions if previously data members were accessed directly because now they a private.
  • Add an extra override for ``base_response_builder_t::append_header()`` receiving http_header_field_t instance as an argument:
    // Global variable
    const http_header_field_t cached_server_hf{restinio::http_field_t::server, "My server"};
    // In some function.
    // Use cached value and avoid extra
    // restinio::http_field_t to string representation lookup.
    resp.append_header( cached_server_hf );
  • Add ``restinio::make_date_field_value()`` functions to format Date header fields (e.g. ``Fri, 15 Jun 2018 13:58:18 GMT``).
  • Enhance ``sendfile_t`` with file meta information. See file meta.
    Now it is easy to get file last modification timestamp:
    auto sf = restinio::sendfile( file_path );
    auto modified_at = restinio::make_date_field_value( sf.meta().last_modified_at() );
      // ...
        std::move( modified_at ) )
      // ...
  • Introduce ``restinio::http_status_line_t`` and a bunch of accompanying stuff, so now a standard response code and reason phrase can be set easily (status line). Now a standard response status can be set this way:
    req->create_response( restinio::status_not_found() ); // 404 Not Found
    req->create_response( restinio::status_bad_request() ); // 400 Bad Request
    req->create_response( restinio::status_not_implemented() ); // 501 Not Implemented

RESTinio is hosted on bitbucket (github mirror).

Archive is available in download section.

Documentation with helpful information is here.

If you miss something in RESTinio and want to see some new features let us know via